Hi,
I am trying to run jomo imputation with clustered data and I am getting error message (see below). My dataset is test_impute which is open in the R environment, but still the error message below says object not found. Could you please help me? I have a tight deadline.
library(jomo)
Y<-test_impute[,c("gait","peakflow")]
#> Error in eval(expr, envir, enclos): object 'test_impute' not found
clus<-test_impute[,c("country")]
#> Error in eval(expr, envir, enclos): object 'test_impute' not found
v<- test_impute[,c("sex", "ability","grip","bmic")]
#> Error in eval(expr, envir, enclos): object 'test_impute' not found
cov<-na.omit(v)
#> Error in na.omit(v): object 'v' not found
X=data.frame(rep(1,117982),cov[,c("sex", "ability","grip","bmic")])
#> Error in cov[, c("sex", "ability", "grip", "bmic")]: object of type 'closure' is not subsettable
colnames(X)<-c("sex", "ability","grip","bmic")
#> Error in colnames(X) <- c("sex", "ability", "grip", "bmic"): object 'X' not found
Z<-data.frame(rep(1,117982))
beta.start<-matrix(0,2,2)
u.start<-matrix(0,10,2)
l1cov.start<-matrix(diag(1,2),20,2,2)
l2cov.start<-diag(1,2)
l1cov.prior=diag(1,2);
nburn=as.integer(50);
nbetween=as.integer(20);
nimp=as.integer(5);
l2cov.prior=diag(1,5);
a=3
Finally we run either the model with fixed or random cluster-specific covariance matrices:
imp<-jomo1ranconhr(Y,X,Z,clus,beta.start,u.start,l1cov.start, l2cov.start,
l1cov.prior,l2cov.prior,nburn,nbetween,nimp,meth="fixed")
#> Error in jomo1ranconhr(Y, X, Z, clus, beta.start, u.start, l1cov.start, : object 'X' not found