Hi Stata Forum
I have an unbalanced set of panel data with individuals having a measurement at baseline. Some may have had the measurement repeated again at a second, or third or fourth visit.
For example example, there were 15000 who had a first measurement, 5000 with a second measurement, 1000 with a third measurement.
As ID have missing measurements for the variable of interest (X) across all time-points, I have performed multiple imputation for this (missing ~10% of measurements).
Data is in long format and xtset after multiple imputation.
I want to analyse only those id who had a measurement value X<7 at the first visit, and see what their trajectory is on subsequent visits, i.e. restrict initial observations to only those with this value.
I was thinking of performing: mi estimate: xtreg X i.visit "(if X<7 on first visit)"
I am not sure how to code this last part, or how to create a variable that is conditional on a specific time point.
I am also not sure if I can apply xtgraph after multiple imputations as well...but initially, I just want to review the coefficients.
I've tried mi xeq: gen newvar=1 if X<7 & visit==1. But then I am not sure how to include only these subjects again.
Reading the cond() help file for conditional variable generation doesn't appear to solve my issue.
Thank you for any assistance.
Nitesh Nerlekar
(Using Stata 14).
Related Posts with Help generating and analysing a repeated variable conditional on a specific baseline time-point and value.
Two variables combined fixed effect with clustered standard errors of another variableHi Stata community, I have an unbalanced panel data set for the years 1992-2018 across different ye…
How to test for multiple instruments in in etregress or eregressDear all: I am using Stata 15 to run a linear regression with endogenous treatment aiming to do inst…
Combine multiple columns into oneHi all, If there is a loop like following: Code: forv y = 2009/2012 { forv p = 1/20 { egen `…
snapshot with descriptive names instead of numbersI just upgraded to Stata 16 today and I was experimenting with the new frames feature. This allows a…
Adoupdate not working in new installationDear users, I recently installed Stata 15 in a new machine with Windows 10. I first download -ftools…
Subscribe to:
Post Comments (Atom)
0 Response to Help generating and analysing a repeated variable conditional on a specific baseline time-point and value.
Post a Comment