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
Multilevel poisson gives same results as regular poisson with clustered standard errors?Hello, My data is at the product-level. However, many of the covariates in my specification of inte…
Calculate difference of an outcome variable between timepointsHi, I have the following dataset in a long format with 6 records per patient_id corresponding to 3 …
causal mediation analysisHi, when performing causal mediation analysis, how do I get the value of proportion effect mediated?…
reshape wide variable to long within long datasetHi, I have a long dataset that has a wide variable in it (loc). Loc represents location of work per…
Why do ginidesc command yield different Gini coefficients when combined with the "if" qualifier?Dear Statlist users, I am using Stata 14.1. I am trying to estimate wage inequality (by Gini coeff…
Subscribe to:
Post Comments (Atom)
0 Response to Replace missing data with mean or average for summative scale purposes
Post a Comment