Dear Stata folks,
I have a dataset with patient_ids, days and a measurement(outcome). Patients may have more than one measurements per day. The number is unequal between patients and days. Let's say that it is the BP measurements.
The days are in %td format but not consecutive, since some patients may non have measured their BP a day and then measure it the next days. Patients are advised to do these measurements for 28 days but some did it for less and few others did so for more.
I want to create a consecutive day variable so as to have 0 measurements when they have not measured their BP, instead of having only the measurements for the days that they did measure.
Any help please? Whatever I saw in different posts doesn't work for my case.
Thank you in advance.
Related Posts with Create consecutive days with unequal number of obs per day
Generating a new variable as a result of comparing the mean of a variable (t-test) in two different timesHi, I have three variables here in my example, as described below. 1) EXP: is the time dummy variab…
New version of xtdcce2 and xtcd2. New package xtcse2Thanks to Kit Baum a new version of xtdcce2 and xtcd2 is available on SSC. In addition a new program…
cox regression with shared frailty or vce clusterHello, In running a cox regression model (stcox), I would like to look at within group correlation.…
Create mean variables of a subgroup for the whole groupDear all, I have data on education attainment per year and state and I want to compute the percenta…
generate variable: birth order of children (ages 0 to 17) in householdHello I am using the South African NIDS (National Income Dynamic Survey) wave 1 to wave 5. I have s…
Subscribe to:
Post Comments (Atom)
0 Response to Create consecutive days with unequal number of obs per day
Post a Comment