Dear all, Amelia works fine when I do NOT specify any variables that should
be logged. As soon as I include logs, I get an error ("#Error in
matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, :
negative extents to matrix"). I checked that the variables to log can be
logged (no negative/zero values). I'm grateful for any hints. Best, Nicole
--Rcode--
#load MI package
require(Amelia)
set.seed(1000)
#load data set
load(url("http://schreiberin.de/nicole.Rdata"))
n <- nicole
dim(n) #3822 59
class(n) #"data.frame"
# Declare variables to be logged vlogs <- c("GDP_const2000" ,
"GDP_curr"
,"population" , "lifeexp" ,"infmortality" ,"trade"
, "l_US_fdi_total" ,
"l_US_fdi_petrol" , "l_US_fdi_total_manuf","l_US_fdi_food" ,
"l_US_fdi_chemical" , "l_US_fdi_prim_fab_metal"
,"l_US_fdi_machinery",
"l_US_fdi_electrical" , "l_US_fdi_transport"
,"l_US_fdi_whole_trade",
"l_US_fdi_depository" ,
"l_US_fdi_finance_except" ,"l_US_fdi_mining" ,
"l_WB_FDI_percentGDP" ,
"l_WB_FDI_curr" , "l_UN_FDI_flow" , "l_UN_FDI_flow_pgdp" ,
"l_UN_FDI_stock", "l_UN_FDI_stock_pgdp" )
amelia.out <- amelia(n, m=5, ts="year",
cs="country",intercs=TRUE,polytime=1,logs=vlogs) #Error in
matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, :
negative extents to matrix
--END Rcode--
--
Nicole Janz, PhD Cand.
Lecturer at Social Sciences Research Methods Centre 2012/13
University of Cambridge
Department of Politics and International Studies
www.nicolejanz.de | nj248(a)cam.ac.uk | Mobile: +44 (0) 7905 70 1 69 4
Skype: nicole.janz