Hi,
I am working on a project examining the association between Covid-19 and a number of pregnancy outcomes.
I have merged test data to a pregnancy dataset. The test data merged on the pregnancy data is in wide format and covers positive tests taken during the entire pandemic.
I want to make a loop counting the number of dates of a registered positive test (some of the observations in the dataset have more than one registered positive tests) during an interval from the start of pregnancy to the end of pregnancy.
I have tried out the code below, but it will not run, and I get the message 'varlist not allowed'.
Code:
forvalues i=1/11 {
count PRDATE`i' if PRDATE`i'>=date_conception & PRDATE`i'<=preg_outcome
} I hope you can help me out to get the code right. Thanks in advance.
Best,
Trine.
I am working on a project examining the association between Covid-19 and a number of pregnancy outcomes.
I have merged test data to a pregnancy dataset. The test data merged on the pregnancy data is in wide format and covers positive tests taken during the entire pandemic.
I want to make a loop counting the number of dates of a registered positive test (some of the observations in the dataset have more than one registered positive tests) during an interval from the start of pregnancy to the end of pregnancy.
I have tried out the code below, but it will not run, and I get the message 'varlist not allowed'.
Code:
forvalues i=1/11 {
count PRDATE`i' if PRDATE`i'>=date_conception & PRDATE`i'<=preg_outcome
} I hope you can help me out to get the code right. Thanks in advance.
Best,
Trine.
Comment