Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Jorge Eduardo Pérez Pérez <jorge_perez@brown.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: calculation of area under curve with stata |
Date | Wed, 16 Oct 2013 14:56:42 -0400 |
I am not sure if I am understanding this correctly, but I think you want to calculate the area under the curve of a plot of BP measures against time for each animal. This could be achieved by calculating the area under each trapezoid for each measure and adding them: clear set seed 1234 set obs 10 gen time=_n+uniform() gen measure=uniform() twoway area measure time * Area of trapezoid for each time gen area=(measure+measure[_n-1])*(time-time[_n-1])*0.5 * Add them egen tarea=total(area) sum tarea Hope this helps, -------------------------------------------- Jorge Eduardo Pérez Pérez Graduate Student Department of Economics Brown University On Mon, Oct 14, 2013 at 4:38 AM, elmir <elmir.omerovic@gmail.com> wrote: > Dear All, > > I am analyzing the blood pressure (BP) levels from the three different > groups of animals. BP was measured repeatedly in every animal at 10 > different time points within 90 minutes from the start of the experiment. > The animals were exposed to 3 different drugs (each group n=8). > > I understand that one way to compare the effect of the drugs on blood > pressure within the whole experimental period would be to calculate the area > under the curve and to use this value in a linear mixed model. > > I would be very grateful if someone could help me with step-by-step > instructions how to calculate AUC in stata. > > Kind regards > > Elmir Omerovic MD, PhD > Sahlgrenska University Hospital > Gothenburg, Sweden > > > > -- > View this message in context: http://statalist.1588530.n2.nabble.com/calculation-of-area-under-curve-with-stata-tp7580438.html > Sent from the Statalist mailing list archive at Nabble.com. > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/