Hello, I'm a long-time lurker and first time poster.
I have a dataset in Stata with units (say, statefips codes) and dates at regular intervals (say, daily) and observations on variables X, Y, and Z.
I would like to extend my panel backwards in time T number of days, filling in the variables X, Y, and Z with 0 for all units. I have to do this many times, so manually inserting a first observation and then using carryforward could be prohibitively time consuming. Thank you.
Related Posts with Making a Balanced Panel Dataset in Stata 16 from (Almost) Scratch
Creating a mean for each person ID conditional on another variableHello, I have a long dataset with multiple observations of a value (value) per person id (pid). I h…
obtaining distribution measures from estimated densitiesHi folks, for an income decomposition procedure I use the -kdensity- function to obtain probability…
Interactions in mvprobitDear all, is there any way to integrate interactions in -mvprobit-? I tried it, but Stata (14.2) al…
Survival Analysis: Problem with setting up time to event data (years vs periods of time)Dear Statalist users, I am setting up a survival model, where I look at the farmers' time to adopti…
Best code to replicate line graph with error barsHi Statalilst I want to replicate this graph: Array I use STATA 15.1. I have a large pooled cross-…
Subscribe to:
Post Comments (Atom)
0 Response to Making a Balanced Panel Dataset in Stata 16 from (Almost) Scratch
Post a Comment