# r help

1. ### Profile Confidence Interval in lmer model .

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...
2. ### Testing Parameters of Mixed Model .

This pdf illustrates nicely how is to test the random effect of multilevel model . But I am simulating data from a two-level model and estimating the parameters of the model for various combination of the parameters. For each condition , I generated 1000 simulated data sets. I have used R for...
3. ### "getVarCov" in lme

Is "getVarCov" of lme output gives variance-covariance of estimated "Standard Deviation" of random effects or variance-covariance of estimated "variance" of random effects . library(nlme) fm1 <- lme(distance ~ age, data = Orthodont) VarCorr(fm1) getVarCov(fm1) That is , VarCorr(fm1)...
4. ### Specifying the variance component model "varComp" in R .

I am trying to fit a random slope model by "varComp" in R . For the following example , that is in "lmer" syntax , how can I write it in "varComp" syntax : library(lme4) library(varComp) fm1 <- lmer(Reaction ~ Days + (Days||Subject), sleepstudy) I am not understanding...
5. ### Standard Error of variance component from the output of lmer .

I want to extract the "standard error" of variance component from the output of "lmer" . library(lme4) model <- lmer(Reaction ~ Days + (1|Subject), sleepstudy) The following produces estimates of variance component : s2 <- VarCorr(model)\$Subject[1] It is **NOT**...
6. ### How to compute mean of each variables of a list in R ?

The following is a function of simulating data from simple linear regression and calculating non-coverage probability of each parameters . simfun <- function(n,b0,b1,sig){ x <- runif(n) y <- b0+b1*x+ rnorm(n,0,sig) data <- data.frame(y=y,x=x) } noncoverage <-...
7. ### Calculating Non-Coverage Probability .

Hi , I have a two-level model with one explanatory variable (X) on the respondent level, and one group-level explanatory variable (Z) . I am following this paper http://joophox.net/publist/methodology05.pdf I am simulating data from the model . Three conditions are varied in the simulation...
8. ### Penalized quasi-likelihood

Can anybody explain me why the function glmmPQL(.) in R behaves in different ways, depending on the number of measurements/individuals you use? To show you this, I generated two examples. The first one includes 20 indivduals with each 100 repeated measurements (binary response), the...
9. ### Estimating Multilevel Logistic Regression Models

The following multilevel logistic model with one explanatory variable at level 1 (individual level) and one explanatory variable at level 2 (group level) : \text{logit}(p_{ij})=\pi_{0j}+\pi_{1j}x_{ij}\ldots (1) \pi_{0j}=\gamma_{00}+\gamma_{01}z_j+u_{0j}\ldots (2)...
10. ### Performing multiple t-tests on different variables between the same two groups

Hey everyone I would like to perform multiple t test on different variables ( let's say A B C D E ) in two different groups ( 1 2 ) and test if the means, variance, kurtosis is significantly different between A1 and A2, B1 and B2 etc. How do you think I should go about this in R or SAS ...
11. ### Comparing negative binomial model to the null model with offsets

Hi there, I have a negative binomial model of count data with an offset (total counting effort) in R: L1<-glm.nb(counts~offset(log(total.counts))+temperature, link='log', data=dat) and I want to compare it to the null model. Am I right in thinking I can just do...
12. ### Interpreting a Summary Table in R (Specifically Estimated Coefficients)

I feel like an idiot for asking this question, but I always get mixed up with this. For those curious, I'm using the dataset attached to this post. So I was told in this problem to fit simple regression models with kid_score being the response variable and all the mom categories being the...