Page 1 of 1

Error: plotting model averaged estimates against covariates

PostPosted: Wed Apr 29, 2020 9:57 pm
by rachelselwyn
I'm trying to plot model averaged estimates for psi and p against various covariates using the predict function to get a smooth surface. I have no problems using modavg function with the predict argument with example data using code like<-modAvg(,param="psi",
However, when I try to run a similar code with my data and AIC output I consistently get an error:
" Error in pred.mat %*% coeff : non-conformable arguments".
I have designed the newdata to match the structure of the initial dataset, same length and all the same unitcov names. I have tried everything I can think of but cannot get the error to go away and for the predict function to work.
Does anyone have any ideas what could be causing the problem? This is my newdata and Modaveraged predict code :<-data.frame(hab=c("alluvialbench","uplandgranite","lowlandsandstone","peatswamp","freshwaterswamp"),
z_pheno=seq(min(BP$unitcov$z_pheno), max(BP$unitcov$z_pheno), length=2500), z_elev=seq(min(BP$unitcov$z_elev),
max(BP$unitcov$z_elev), length=2500), z_elev_sq=seq(min(BP$unitcov$z_elev_sq), max(BP$unitcov$elev_sq), length=2500),
h_index=seq(min(BP$unitcov$h_index), max(BP$unitcov$h_index), length=2500), effort=seq(min(BP$unitcov$effort), max(BP$unitcov$effort), length=2500),
off_trail_=c(0,1), time=seq(min(BP$unitcov$time), max(BP$unitcov$time), length=2500))<-modAvg( =bporesults,param = "psi", predict=TRUE, newdata = )


Re: Error: plotting model averaged estimates against covaria

PostPosted: Wed Apr 29, 2020 11:18 pm
by jhines
Hi Rachel,

If you send me your R script and data files, (or just use save.image and send me the rdata file), I'd be happy to diagnose the problem.

Jim (