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?
Generating observation in statahey all, Can anyone help me to generate 1000 observation of the F distribution with parameters diffe…
Collecting exact 95% CII am conducting a survey analysis where I'm looking at proportions with the svy command. I'm using t…
Multiple imputation for handling missing data in multiple covariatesDear All, While adapting multiple imputation in longitudinal datasets to handle missing data in mul…
testing for serial correlation in residuals of fixed effects model (xtqptest on reghdfe)I want to test for first order serial correlation in the residuals of this Stata regression model: …
Displaying a Complex TableGood morning everyone! I'm quite new to STATA and try to display a complex table, but even after ho…
Subscribe to:
Post Comments (Atom)
0 Response to How do I fill in missing values using the highest/last observation-year?
Post a Comment