Hello everyone,
I would like to replace the missing values (leftceo) by the last given observation-year, to calculate the tenure of a CEO.
This means in my case that the three missing values should be replaced by "2020".
I tried the following command: "bysort gvkey_year: replace leftceo=max(YEAR) if missing(leftceo)". Unfortunately Stata states that it is an invalid syntax.
Could someone help me, please?
Thanks in advance!
Array
Related Posts with How do I fill in missing values using the highest/last observation-year?
How Can I Assign Specific Values to a Subsample According to a Percentage Distribution?Hello everyone! I am new in this forum and looking forward to the discussions on Stata! I am curren…
How exactly does Stata calculate derivatives via the margins command for nonlinear functions?I would like to be able to manually reproduce the results that Stata provides from the margins comma…
ROC - lower score is higher riskHi, this is probably a very basic question but I am trying to create ROC curves for strength scores …
Marginal effects graph blank after using fixed effectsHi all, When trying to produce a marginal effects graph using fixed effects, the output is blank. …
Change date abbreviation in multible observationsHey, I have dates according to the following dataset: Code: * Example generated by -dataex-. To …
Subscribe to:
Post Comments (Atom)
0 Response to How do I fill in missing values using the highest/last observation-year?
Post a Comment