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
Multiple Comparison of Predictive MarginsDear all Statalists, I am using the following model in Stata 16.1: Code: nbreg y i.x1 i.x2 (other …
How to convert categorical variables (name of industries) into letters?Good morning to the community. I would like to convert automatically categorical variables (names …
(Struggling with Paramed Mediation)Hey everyone, So Im having a difficulty running paramed mediation package stata. Im receiving the f…
marginsplot spacing issueThis is my first post on the forum. Thanks in advance for any response. I am using marginsplot in St…
heatmap from correlation table (matrix)This is post to share how to make a heatmap based on a correlation matrix (as in picture attached). …
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