Hello Stata Users,
I have been trying to import previously imputed data (m=0, 1,2,…..20) using mi import command. The data set includes the original un-imputed data(m=0) which has missing values and 20 (m=1,2,3.....20) imputed datasets. Below is my code:
mi import flong, m(imp_number) id(record_id) imputed(v1 v2 v3 v4 v5 v6)
When I run the above code it returns with an error message.
“variable record_id has invalid values
record_id takes on at least one value if imp_number>0 that it does not if imp_number==0”
However, the same code works if I delete the original data and import only imputed datasets. But the problem is it takes first imputed dataset (m=1 reads as m=0) as original and takes remaining 19 imputed dataset which is not correct.
Can anyone please help me in importing the data with the original included?
Thanks in advance.
Baker
Related Posts with Importing previously imputed data using mi import
How to count the number of variables in multiple locals and meanwhile to compute the mean value of each group using for loop in Stata?As the title suggested, I would like to count the number of variables in multiple locals and meanwhi…
Esttab not giving the right outputHello, I am trying to create a table (4 columns and 3 rows) with names of states (variable state_na…
Occupation categoization according to STEM definitionHello stata community, I believe I'm having trouble coding the occupation of IPUMS CPS dataset acco…
Seemingly Unrelated Regression with endogenous variablesCan I use Seemingly Unrelated Regression for system of equations in which I have an institutions var…
Conditional scatterplot (partial regression plot) for a quadratic relationshipDear Statalist members, I would like to plot a conditional (i.e. partial) relationship whose true f…
Subscribe to:
Post Comments (Atom)
0 Response to Importing previously imputed data using mi import
Post a Comment