I am analysing data for foursurvey years of the same survey that runs biannually (except the first two years) that I've merged as a single dataset
When I run a twoway line chart, Stata 18 is filling in the "missing" years (which are not missing, just don't exist).
Year variable is SurveyYear; 1==2018 2==2019 3==2021 4==2023
I want the mean of the variable Superv_scale as the y variable over the four years:
bysort SurveyYear: egen MeanSupvision = mean(Superv_scale)
twoway line MeanSupvision SurveyYear
The resulting graph shows each year from 2018 -2023 on the x axis.
I saw a comment n the forum to add cmissing to the twoway line, but that didn't do anything noticeable.
Any thoughts how to stop the filling in of years?
When I run a twoway line chart, Stata 18 is filling in the "missing" years (which are not missing, just don't exist).
Year variable is SurveyYear; 1==2018 2==2019 3==2021 4==2023
I want the mean of the variable Superv_scale as the y variable over the four years:
bysort SurveyYear: egen MeanSupvision = mean(Superv_scale)
twoway line MeanSupvision SurveyYear
The resulting graph shows each year from 2018 -2023 on the x axis.
I saw a comment n the forum to add cmissing to the twoway line, but that didn't do anything noticeable.
Any thoughts how to stop the filling in of years?
Comment