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
nesting cond()hi All, I was reading the stata journal version: The Stata Journal (2005) 5, Number 3, pp. 413–420 …
Help with instrumental variable regressionHello everybody, I need your help please. I have a dummy variable which is potentially endogenous. …
Interpretation of interaction effect with -margins-I'm currently researching the effect of gender on the performance of microfinance institutions (MFI)…
Translate R to STATAHello, I would like to translate this R formula below in Stata. My data : translate <- contains…
Stata -system run out of application memoryHi all, I am running a do file on Stata that generates a set of quite large tempfiles (one is around…
Subscribe to:
Post Comments (Atom)
0 Response to Create 50 .dat-files from stata after imputation
Post a Comment