Difficulty to construct profile confidence interval in lmer model - r

When I fit lmer model with my data , there is no warning message. But when I tried to construct confidence interval by confint , it shows the following warning message :
Warning messages:
1: In FUN(X[[i]], ...) : non-monotonic profile
2: In nextpar(mat, cc, i, delta, lowcut, upcut) :
Last two rows have identical or NA .zeta values: using minstep
3: In FUN(X[[i]], ...) : non-monotonic profile
Is there any way to overcome the warning message , that is, is there any argument(option) which can remove the problem ? I have used the argument control=lmerControl(optCtrl=list(maxfun=20000)) :
fit <- lmer(Y~X+Z+X:Z+(X||group),data=dat,control=lmerControl(optCtrl=list(maxfun=20000)))

Related

Trying to conduct a Stepwise LDA in R but keep receiving an error message

I am running a stepwise LDA to look at how to discriminant against two groups (P vs NP) based on 4 variables. I ran the lda function with no problems but when I try to do the stepwise function I get this message:
Error in if (any(member < 0) || any(member > 1)) stop("membership values (posterior probabilities)", :
missing value where TRUE/FALSE needed
In addition: Warning message:
In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
this is my line for the forward LDA
stepclass(ï..Pregnancy.State ~ Rad.Length+Circ.Length+Area+X.Collagen.Content, data=both.pulm, method="lda", fold=35, direction="forward")
I ran this on 3 other groups as well with no problems

Error with micombine.cor with miceadds

I do not have a reproducible example here but I am hoping to see if the following error is diagnostic of an obvious problem.
Using miceadds, I am running correlations on data that has been imputed with MICE. I receive the following error when a continuous variable ("6") (-0.5 to 1.4) is added to the model.
micombine.cor(imp, variables=c(3:4:5:6))
Above results in the following error
Error in stats::cor(dat_ii, dat_jj, method = method, use =
"pairwise.complete.obs") :
'y' must be numeric
In addition: Warning messages:
1: In 3:4:5 : numerical expression has 2 elements: only the first used
2: In 3:4:5:6 :
numerical expression has 3 elements: only the first used

Error in plotting a C5.0 decision tree in R

I'm trying to plot my decision tree model.
cnt_c50 <- C5.0Control(CF=0.25,minCases=30,sample=0.7)
myTree <- C5.0(Y ~ X1+X2+X3+....+X30, data=data, control= cnt_c50,trials=100)
summary(myTree)
When I run summary(myTree) there is no warning, no error, everything is fine.
But when I want to visualize it : plot(myTree) , I have this error message :
Error in partysplit(varid = as.integer(i), index = index, info = k,
prob = NULL) : minimum of ‘index’ is not equal to 1 In addition:
Warning message: In min(index, na.rm = TRUE) : no non-missing
arguments to min; returning Inf
I tried to define which tree I want to visualize with plot(myTree,trial=9), and it returns this message :
Error in !all.equal(diff(sort(unique(index))), rep(1, max(index, na.rm
= TRUE) - : invalid argument type
When I try with trials=1 instead of trials=100, I have this message :
Error in if (!n.cat[i]) { : missing value where TRUE/FALSE needed
I also tried this because I saw it in a response on this website but it seems to be for CART Trees :
library(rattle)
fancyRpartplot(myTree)
and I have this error :
Error in if (model$method == "class") { : argument is of length zero
I read that it could be due to a lack of values in a category (for example a category with only 1 or 2 people) so I ran without some variables with small categories but it was the same.
I also tried this function http://r-project-thanos.blogspot.fr/2014/09/plot-c50-decision-trees-in-r.html but I am not a good programmer and I had errors too...
Did anyone have the same problem and can help me ?
Thanks a lot

polycor package - hetcor error in optim

I'm trying to run a factor analysis on a set of 80 dichotomous variables (1440 cases) using the hector function from the polycor package and the instructions I found here: http://researchsupport.unt.edu/class/Jon/Benchmarks/BinaryFA_L_JDS_Sep2014.pdf
Sadly, after I select just the variables interest from the rest of my dataset and run the factor analysis on them, I seem to consistently get the following error and warnings
Error in optim(0, f, control = control, hessian = TRUE, method = "BFGS") :
non-finite finite-difference value [1]
In addition: Warning messages:
1: In log(P) : NaNs produced
2: In log(P) : NaNs produced
This is with the command/when I hit the step described in the above PDF:
testMat <- hetcor(data)$cor
No idea what this means or how to proceed... Your thoughts are appreciated. Thank you!

Warning Messages : confint command for lmer model

I am doing a simulation study for sample size calculation for multilevel modeling. I am using R for both simulation and estimation . As posted in this post , confint function was not working and that was due to model mis-specification . As, I have one independent variable (X) at individual level and one independent variable (Z) at group level and since the simulation study assumes a zero correlation between the intercept deviations and X effect deviations across grouping factors , the model need to be specified as :
fit <- lmer(Y~X+Z+X:Z+(X||group),data=sim_data)
Now the confint.merMod function works . But another problem arises . I am checking the effect of sample size for various combination of parameters . But for small group size , I found warning message more than 50 (though it produces a result also) . Some of those are :
Warning messages:
1: In optwrap(optimizer, par = thopt, fn = mkdevfun(rho, ... :
convergence code 3 from bobyqa: bobyqa -- a trust region step failed to reduce q
4: In zeta(shiftpar, start = opt[seqpar1][-w]) :
slightly lower deviances (diff=-1.42109e-14) detected
5: In nextpar(mat, cc, i, delta, lowcut, upcut) :
Last two rows have identical or NA .zeta values: using minstep
7: In zetafun(np, ns) : slightly lower deviances (diff=-1.42109e-14) detected
8: In FUN(X[[i]], ...) : non-monotonic profile
24: In nextpar(mat, cc, i, delta, lowcut, upcut) :
unexpected decrease in profile: using minstep
25: In profile.merMod(object, which = parm, signames = oldNames, ... :
non-monotonic profile for (Intercept)
But there are no warning message , if I increase the number of group size .
In this case , should I worry of the warnings ?

Resources