I'm wondering if someone can help me with creating .dat-files from a stata dataset after I applied data-imputation.
I first imputed data:
mi register imputed attitude emp_scale serious_sce attrib selfeff colleg collef ///
leadership decision Harmful Powerimb Repetition Intention
mi impute mvn attitude emp_scale serious_sce attrib selfeff colleg collef ///
leadership decision Harmful Powerimb Repetition Intention = liketoint, ///
add(50) rseed (53421)
Subsequently, I saved these datafiles as .dta-files with:
preserve
forval i=1/50{
mi extract `i', clear
save mi_file`i',
restore, preserve
}
However, I would like to create the same files in .dat-file-types.. Is this possible?
I tried this:
foreach i in `_mi_m'{
use "C:\Users\Oct17.dta", clear
drop if _mi_m !=`i'
export delimited _mi_m using "C:\Users\\`i'\Oct17.dta",
replace delimiter(tab) nolabel novar
}
but it did not work, neither did this:
use "C:\Users\16oct.dta", clear
egen which = group(_mi_m), label
sum which, meanonly
forval i=1/`r(max)'{
local where : label (which) `i'
export delimited $vars if which==`i' using "C:\Users\`where'/DV/17okt.dat",
delimiter(tab) nolabel novar replace
}
I also tried to replace $vars with "_mi_m", but that did not work either. I do not understand how to export these 50 datafiles and create .dat-files at the same time, is this even possible? Thank you in advance for any help!
Related Posts with Create 50 .dat-files from stata after imputation
Dropping Variables Based on Other Variable, Student ProjectHey there, I'm a student working with Stata and have a data set that contains a variable associated…
combine variables panel data graphsHi I'm working with panel data, trade among 10 countries in the past 27 years. I want to add and gra…
Creating graphs for logistic regressionHello Everyone, I am currently working on my master thesis and finishing my quantitative analysis. …
Bootstrapped standard errors in panel data with sample weightsHello there, I am working with a panel collected from the Panel Study of Income Dynamics (survey da…
Set seed command not respected for -bsqreg-Hi all, I am using the following code to attempt to get reproducible results for a median regressio…
Subscribe to:
Post Comments (Atom)
0 Response to Create 50 .dat-files from stata after imputation
Post a Comment