Hi all,
I have a panel dataset on productivity. The variables are as follows:
activity = the activity/task an employee is doing (e.g. phone call, ACW (after call work), chat, administration).
week = week number
Basically, I need to drop the observations if activity is "ACW" when the previous activity was "Chat" in week 22 only.
The command i have so far is thus: drop if activity==ACW if week==22 & (the previous activity was "Chat")
Also, ACW has a value label of 3, so the real command will be: drop if activity==3 if week==22 & (the previous activity was "Chat")
Chat has a value of 7.
I tried everything, but I cannot find out the right command for the bold part. Can someone help me out?
Thank you in advance.
Related Posts with Drop observations based on value of previous observation
Properly interpreting odds ratios vs marginal effectsDear Statalist, I would like to kindly ask for help in the interpretation of these variables in a lo…
post __000000 not found - Fama French Carhart related topicHello, I'm trying to run the following code but I don't know where is the error. The same code has b…
Adjusting treatment effect for crossover type of non adherence in a two arm trialDear statalist, I have a dataset from a trial where subjects were allocated to either standard of ca…
Difference between manual 2sls and ivregressI have a regression with an endogenous variable for which I have an instrument. By computing ivreg i…
Multivariate polynomial regression modellingHello everyone, I wanted to ask the most appropriate method for finding the best polynomial model fo…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations based on value of previous observation
Post a Comment