Untitled

 avatar
unknown
plain_text
2 months ago
1.7 kB
1
Indexable
from graphviz import Digraph

# Create a flowchart for Experiment 5
flowchart = Digraph(format="png", name="Experiment_5_Flowchart")

# Define nodes
flowchart.node("Start", "Start: 100 Volunteers (30 Men, 70 Women)", shape="oval")
flowchart.node("Block", "Split by Gender", shape="diamond")
flowchart.node("Men", "Men: 30 Participants", shape="box")
flowchart.node("Women", "Women: 70 Participants", shape="box")
flowchart.node("Men_Random", "Random Assignment\n15 Yoga, 15 No Yoga", shape="diamond")
flowchart.node("Women_Random", "Random Assignment\n35 Yoga, 35 No Yoga", shape="diamond")
flowchart.node("Men_Treatment", "Yoga Group: 15 Men", shape="box")
flowchart.node("Men_Control", "No Yoga Group: 15 Men", shape="box")
flowchart.node("Women_Treatment", "Yoga Group: 35 Women", shape="box")
flowchart.node("Women_Control", "No Yoga Group: 35 Women", shape="box")
flowchart.node("End", "Compare Changes in Stress Levels", shape="oval")

# Define edges
flowchart.edge("Start", "Block")
flowchart.edge("Block", "Men")
flowchart.edge("Block", "Women")
flowchart.edge("Men", "Men_Random")
flowchart.edge("Women", "Women_Random")
flowchart.edge("Men_Random", "Men_Treatment", label="Yoga")
flowchart.edge("Men_Random", "Men_Control", label="No Yoga")
flowchart.edge("Women_Random", "Women_Treatment", label="Yoga")
flowchart.edge("Women_Random", "Women_Control", label="No Yoga")
flowchart.edge("Men_Treatment", "End")
flowchart.edge("Men_Control", "End")
flowchart.edge("Women_Treatment", "End")
flowchart.edge("Women_Control", "End")

# Render the flowchart
flowchart_path = "/mnt/data/Experiment_5_Flowchart.png"
flowchart.render(flowchart_path, cleanup=True)

flowchart_path
Leave a Comment