Hi, I have a particular year point and I want to analyse observations after that year point and observations that were present both before and after that year point. I tried to create dummy variables in order to separate these observations out. Here is what I did:
I have data for two years 2002 and 2003. The data for each of these years is present for all the twelve months. The year point is February 2003.
So in order to analyse the observations that were present only for February 2003 and afterwards, I did the following :
summarize id if year==2003 & month=February|year=2003 & month==March|year=2003 & month==April|year=2003 & month==May|year=2003 & month==June|year=2003 & month==July|year=2003 & month==August|year=2003 & month==September|year=2003 & month==October|year=2003 & month==November| year=2003 & month==December
This code have appeared to work.
However, when I try to include observations that were present for both before and after February 2003, I cannot think of a way to use a similar command as above. (Note that there are observations that were present only before February 2003. However, these observations are not of interest. ) Does anyone have a better suggestion for doing this task? Any suggestions would be helpful. Thanks!
Related Posts with Analysing observations based on a year point
Propensity Score Matching and Panel DataDear Statalisters, I am currently working on the life satisfaction of potential caregivers. More pr…
How to construct variables based on items from a survey using scaleHi, I have a dataset from a questionnaire with 498 observations. There is item nonresponse present, …
Expanding dataset to create pairwise combinationsHi All, My dataset is as follows: Code: * Example generated by -dataex-. To install: ssc install…
Using Stata to delete files from foldersDear All, This may come as an odd request however, I am trying to understand whether the following …
Problem with generating counts of unique episodes within an ID based on the specific ruleHi everyone, I have data on patients receiving certain medication captured as 9-months episodes. I …
Subscribe to:
Post Comments (Atom)
0 Response to Analysing observations based on a year point
Post a Comment