Hi all,
I am having a matched pair dataset with seropositive as cases and seronegative as controls. Matching of cases and controls were done on village, farm, species, breed and age within 2 years (either direction i.e. older or younger). The pairs are given a number by groupid. we have another variables like milk production (kg), parity (number of times an animal have calved), time since last calving (months) and test status (pos or neg). I want to know the effect of parity, test status and time since last calving on milk production and effect has to take the matched pairs into consideration.
Mr Phil advised the following command:
'' xtset pair
xtreg b_milk_kg i.elisa c_last_calve_months e_parity ,fe
If you're pairing at the village, farm and species level (i.e., the identified pairs are within the same village, farm and species), then fixed effects for pair will control for such things. This can also be done with areg and mixed (previously xtmixed but just mixed in newer versions of Stata) but I'm more comfortable with xtreg.''''
Just wanted to know in place of pair in xtset command, should I write groupid (as matched pairs are identified by groupid) and then the second command:
xtreg b_milk_kg i.elisa c_last_calve_months e_parity ,fe
Thanks
Related Posts with regression on continuous outcome variable paired match case control study
Generating variable and replacing the outlier as missing based on grouping and conditionDear All, I am working with firm level data. I want to generate a variable lsales = ln(sales) and wa…
Variable with negative valuesHey, I'm stuck on a simple thing and would really need some help. I have a non-numeric variable ran…
Why is R2 greater than 1.0 in this PCSE analysis?I encountered a perplexing set of results after running xtpcse. R-squared = 1.1892. Any ideas why th…
Alternatives to ratio of two count variables when there are zerosHello everybody, I apologize in advance for the lengthy post but I just want to provide some contex…
How to count a purchase date of medicines?Hello! This is Babar, quite new here in this forum and here is my first question. " I have a long d…
Subscribe to:
Post Comments (Atom)
0 Response to regression on continuous outcome variable paired match case control study
Post a Comment