Hi, I fully understand the issues with mean imputation, but I still need to use this as a quick solution to build proxy scales (not for publishable work). I have 65 variables and ~10k observations. Observations are named rf1, rf2, rf3...rf65. I've tried this:
foreach var of varlist rf* {
2. quietly sum 'var'
3. replace 'var' = r(mean) if missing('var')
4. }
but I get the "invalid name r(198);" error message. How else could I approach this?
Related Posts with Replace missing data with mean or average for summative scale purposes
dropped data in xtlogit,fehi all, In the xtlogit regression below 17667 groups of data have been dropped. (All variables in th…
Diff-in-Diff with multiple treatment periods and treatment magnitudes?I have a question regarding how to run a generalized diff-in-diff with treatments that are implement…
Psmatch2 and 1000 repetitionsHello all! I would like to ask a help, please. I ran the psmatch2 and now i need to run 1000 times t…
Replacing a variable in a longitudinal dataset based on a criteriaDear Statalist users, I have a longitudinal file in the long format. Please see a part of the varia…
How to Plot a two-way Interaction GraphDear Statalist I'm currently trying to plot a two-way interaction graph. My logit regression code i…
Subscribe to:
Post Comments (Atom)
0 Response to Replace missing data with mean or average for summative scale purposes
Post a Comment