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
how to correct the standard errors when using multiple IVs for only one endogenous variableHello: I would like to ask that when dealing with only one endogenous variable, say X1, is it corre…
reshape issueI am trying to reshape variables from long to wide. I first tried: . reshape wide i(pop_WDI_PW - ri…
Counting observations with an 'if'Hello all, For a large sample of firms, I need to count the number of (1) business segments and (2)…
Future/out of sample predictionsHello, my question is concerning commands that could be used to make out of sample predictions. Spec…
Coefplot: keep / drop coefficients from one model, not the whole plotDear Statalist, I've recently started using coefplot command and like it's versatility, but I canno…
Subscribe to:
Post Comments (Atom)
0 Response to Analysing observations based on a year point
Post a Comment