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
match email across multiple datasetsHi, I have three datasets with master data (userid, names, email addresses, salary etc) data1 (emai…
Negative scale value using fixed effects quantile regression xtqregI have individual-level panel wealth-at-age data with 4600 observations on 350 individuals. Because …
Fleiss kappa coefficient and Kendall coefficientGood morning. How could you calculate Fleiss's Kappa coefficient and Kendall's correlation coefficie…
Comparing population and sample age and sex distributionHi all, I am not so sure if my logic for the code is right or wrong. I have to check if the age and…
Issue about xtpoisson with fixed effects and interpreting interaction effectHi Statalisters, When I use count data model to analyze my panel data with fixed effects, like -xtp…
Subscribe to:
Post Comments (Atom)
0 Response to Drop observations based on value of previous observation
Post a Comment