Dear all,
I receive the following error from realcomImputeLoad. Stata is set to the correct directory containing the impvals and imputeiter files and these seem fine - I've retrieved them and successfully imputed models in MLwiN.
The error (from a couple of lines before it in the traced output) is below. I've copied the output to the end to help colleagues identify where the error is coming in.
I'd very much appreciate any feedback,
Best wishes and thanks for your continuing support
Jamie
set trace on
realcomImputeLoad
. realcomImputeLoad
---------------------------------------------------- begin realcomImputeLoad ---
- version 11.1
- syntax
- preserve
- quietly insheet using impvals.txt, clear
- local numimputations = v1[3]
- local i = 1
....
- noi di in red "`van' type mismatch with other `1' variables"
= noi di in red "v11 type mismatch with other v variables"
v11 type mismatch with other v variables
- exit 198
}
}
else {
capture confirm new var `van'
if _rc {
di in red "`van' implied name too long"
exit 198
}
}
local i=`i'+1
local val : word `i' of $ReS_jv
}
while "`val'" != "" {
Subname `1' `val'
local van "$S_1"
capture confirm var `van'
if _rc==0 {
local nt : type `van'
Recast "`ct'" `nt'
local ct "$S_1"
if "`ct'"=="" {
noi di in red "`van' type mismatch with other `1' variables"
exit 198
}
}
else {
capture confirm new var `van'
if _rc {
di in red "`van' implied name too long"
exit 198
}
}
local i=`i'+1
local val : word `i' of $ReS_jv
}
if "`ct'"=="empty" {
local ct "byte"
}
global rtmpST "$rtmpST `ct'"
mac shift
}
----------------------------------------------- end reshape.mkrtmpST ---
drop _all
set obs 1
if $ReS_str {
gen str32 $ReS_j = ""
}
else gen float $ReS_j = .
save "`new'", replace
parse "$ReS_jv", parse(" ")
while "`1'"!="" {
restore, preserve
noisily Longdo `1'
append using "`new'"
save "`new'", replace
mac shift
}
if $ReS_str {
drop if $ReS_j == ""
}
else drop if $ReS_j >= .
global rtmpST
compress $ReS_j
}
----------------------------------------------------- end reshape.Long ---
- Macdrop
------------------------------------------------ begin reshape.Macdrop ---
- mac drop ReS_j ReS_jv ReS_i ReS_Xij rVANS Res_Xi ReS_atwl ReS_str S_1 S_
> 2
-------------------------------------------------- end reshape.Macdrop ---
- exit _rc
}
------------------------------------------------------ end reshape.DoNew ---
exit
}
-------------------------------------------------------------- end reshape ---
------------------------------------------------------ end realcomImputeLoad ---
r(198);
realcomImputeLoad error
-
- Posts: 1360
- Joined: Mon Oct 19, 2009 10:34 am
Re: realcomImputeLoad error
The only reshape command that I can find in realcomImputeLoad.ado is:
This would match with the error message that you are getting as this refers to a variable starting with v.
I would firstly suggest that you look to see whether there is anything obviously wrong with the input file by running the command:
and checking the imported data. The fourth record should contain a line of filenames, one for each imputed dataset.
If it all looks okay then you can ensure that all the variables are the same type by adding the following code just before the reshape line in realcomImputeLoad.ado:
Code: Select all
quietly reshape long v, i(id)
I would firstly suggest that you look to see whether there is anything obviously wrong with the input file by running the command:
Code: Select all
insheet using impvals.txt, clear nonames
If it all looks okay then you can ensure that all the variables are the same type by adding the following code just before the reshape line in realcomImputeLoad.ado:
Code: Select all
recast str244 v*
Re: realcomImputeLoad error
Dear Chris,
Many thanks again for your support. I identified the problem - v11 was full of missing values - the impval file had some white space after the list of filenames (so a bit hard to spot what was up with it!)
Data now into Stata.
Best wishes and thanks again,
Jamie
Many thanks again for your support. I identified the problem - v11 was full of missing values - the impval file had some white space after the list of filenames (so a bit hard to spot what was up with it!)
Data now into Stata.
Best wishes and thanks again,
Jamie