[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: graph question

From   "Martin Weiss" <>
To   <>
Subject   st: Re: graph question
Date   Sun, 19 Apr 2009 19:14:10 +0200


Working on the CI thing :-)


//create data
set obs 600

gen arm= cond(_n<301,0,1)
lab def arms 0 "control" 1 "experimental"
la val arm arms

egen float interval = fill(0 1 3 6 9 12 0 1 3 6 9 12)

egen float measurement = seq(), from(1) to(50) block(6)

//fictional value of measurement (no systematic diff btw control and experimental group)
gen mymeasurement=rnormal()

//have a look
l in 295/305, noo

//you could collapse this and take it from there
//collapse (mean) mymeasurement, by(interval arm )

//or let the graph bar command take care of business (and retain your precious data :-)) graph bar (mean) mymeasurement, over(arm, label(angle(forty_five) labsize(medsmall))) over(interval)

----- Original Message ----- From: "Nikolaos Pandis" <>
To: <>
Cc: <>
Sent: Sunday, April 19, 2009 6:19 PM
Subject: st: graph question

Hi to all.

I would like to ask the following:

I have continuous data for two trial arms (control and experiment).
There are 50 measurements per arm.
Data is collected at 6 time intervals.

I would like to plot a bar chart with the x axis showing the intervals (0, 1, 3, 6, 9, 12 months). Within each interval I would like to have one bar for the control and one for the experimental group.
The y axis shows the mean of the measurement of interest.

Additionally, I would like to show the confidence intervals at each interval per treatment group.

Alternatively, I would like to draw a line plot with the same y and x axis information, except that the two lines would represent the control and the experimental groups.

Thank you very much,


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index