I have panel data in which my cross-sectional units are farms. I am correcting a variable for the years farmed by the operator. For some farms, it starts at 0, but these farms have data, so the value should be 1. I would need to add 1 for each year for the farms that start out at 0 years, but am unsure how to do that across farms. To be more clear, for the farms that start at 0, I need to add 1 to the years farmed variable for every year for that farm. - Thank you in advance.
Related Posts with Changing variable value across cross-sectional units in panel data if criteria is met
How can I overlap two marginsplot graph???Hi. I always thanks to statalist. I have six years of cross sectional data for SBP and BMI. There …
Breusch-Pagan TestHello I am trying to do a Breusch-Pagan test to test for heteroscedasticity. I have to regression m…
using -encode- with multiple string variablesI use Stata 14 on Windows. I have a data set of 30,000 observations with multiple observations (diff…
Bootstrapping a two-step estimation with survey dataHello everyone, This is more of a clarification question as my code runs without any errors: I am …
using commands to search within a smcl fileIs it feasible to use any command to search for a text string within a smcl file? this would help lo…
Subscribe to:
Post Comments (Atom)
0 Response to Changing variable value across cross-sectional units in panel data if criteria is met
Post a Comment