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
Dropping observations based on certain criteriaHello all, Here is a snippet of the data I am working with: Code: * Example generated by -dataex-…
Testing for Normality using Jarque-Bera in Panel Data (xtsktest + jb)Dear Stata community, currently, I am trying to decide whether my data is normally distributed or n…
Interval Scaled Independent VariablesHello everyone, I know, this is not a question referring to Stata directly, but maybe someone can h…
Meaning of different code1. Create the dummies and estimate levelsof year, local(time) foreach t of local time { local y_rr =…
scatter plotshey there! im using stata 14 and want to create the scatter plots between the K (cutt-offs) and H,A,…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations based on value of previous observation
Post a Comment