Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Multilevel nested data structure


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Multilevel nested data structure
Date   Thu, 8 Nov 2012 22:14:01 -0500

Correction: Second -egen- should be : "egen tdays =".

The second thing you should do is verify that all patients have 8 days of data:

*****************************
egen tag = tag(patient_id day)
egen tdays - total(tag), by(patient_id)
tab tdays  // all equal to 8?
count if tag  //total number of days
****************************

Steve


Please show the exact command and output, as requested at http://www.stata.com/support/faqs/resources/statalist-faq/#stata


Steve


On Nov 8, 2012, at 5:51 PM, Mohammed Mohammed wrote:

Dear stata listers

My data structure has several levels of nesting from a study where patients measure their own blood pressure measurements.

The nesting structure is as follows:-

Family Practice/Patient/Day/blood pressure readings.

Patients are nested within a family practice and over an 8 day period patients measure their blood pressure (multiple readings per day).

I am using xtmixed to identify predictors of the blood pressure, thus:

xtmixed systolic age male || practice_code: || patient_id: || day:

The output from xtmixed suggests  there are 28 family practices (which is correct) and 752 patients (which is correct) and 2225 days (which is not correct as each patient was in the study for 8 days).

I am not sure why the group table at the header of the xtmixed output does not give the proper number of groups for days (as 8). 

I guess i must be doing something wrong....any advice would be much appreciated...

best wishes
M 

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index