similar to: obtaining means/SD after fitting a mixed model

Displaying 20 results from an estimated 4000 matches similar to: "obtaining means/SD after fitting a mixed model"

2006 Mar 24
1
predict.glmmPQL Problem
Dear all, for a cross-validation I have to use predict.glmmPQL() , where the formula of the corresponding glmmPQL call is not given explicitly, but constructed using as.formula. However, this does not work as expected: x1<-rnorm(100); x2<-rbinom(100,3,0.5); y<-rpois(100,2) mydata<-data.frame(x1,x2,y) library(MASS) # works as expected model1<-glmmPQL(y~x1, ~1 | factor(x2),
2005 Oct 19
1
anova with models from glmmPQL
Hi ! I try to compare some models obtained from glmmPQL. model1 <- glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^2)+freq8_4 +I(freq8_4^2), random=~1|num, binomial); model2 <- glmmPQL(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^2)+freq8_4 , random=~1|num, binomial); anova(model1, model2) here is the answer : Erreur dans anova.lme(model1, model2) : Objects must
2005 Jan 24
4
lme and varFunc()
Dear R users, I am currently analyzing a dataset using lme(). The model I use has the following structure: model<-lme(response~Covariate+TreatmentA+TreatmentB,random=~1|Block/Plot,method="ML") When I plot the residuals against the fitted values, I see a clear positive trend (meaning that the variance increases with the mean). I tried to solve this issue using weights=varPower(),
2008 Jul 06
2
Error: cannot use PQL when using lmer
> library(MASS) > attach(bacteria) > table(y) y n y 43 177 > y<-1*(y=="y") > table(y,trt) trt y placebo drug drug+ 0 12 18 13 1 84 44 49 > library(lme4) > model1<-lmer(y~trt+(week|ID),family=binomial,method="PQL") Error in match.arg(method, c("Laplace", "AGQ")) : 'arg' should be one of
2005 Dec 01
3
Strange Estimates from lmer and glmmPQL
I'm trying to fit a generalized mixed effects model to a data set where each subject has paired categorical responses y (so I'm trying to use a binomial logit link). There are about 183 observations and one explanatory factor x. I'm trying to fit something like: (lmer(y~x+(1|subject))) I also tried fitting the same type of model using glmmPQL from MASS. In both cases, I get a
2009 Mar 27
1
add variable in for loop
Hi, I'm learning to write some basic functions in R. For some data I have I'd like to be able to add a variable to itself after each iteration in a for loop to obtain a grandtotal for that variable so I can calculate a mean. test<-function(data){ for (i in 1:80){ meanrotation<-(abs(data[i,3]-data[i,2])+abs(data[i,4]-data[i,2])+abs(data[i,5]-data[i,2])+abs(data[i,6]-data[i,2]))/4
2002 Nov 29
2
Obtaining the variable names of a glm object
Is names(model1$coef) what you're looking for? -----Original Message----- From: Kenneth Cabrera [mailto:krcabrer at epm.net.co] Sent: 29 November 2002 10:36 Cc: R-help at stat.math.ethz.ch Subject: [R] Obtaining the variable names of a glm object Hi, R users! Suppose I make a model like this:
2004 Aug 26
5
GLMM
I am trying to use the LME package to run a multilevel logistic model using the following code: ------------------------------------------------------------------------ ------------------------------------------- Model1 = GLMM(WEAP ~ TSRAT2 , random = ~1 | GROUP , family = binomial, na.action = na.omit ) ------------------------------------------------------------------------
2012 Feb 06
1
lmer with spatial and temporal random factors, not nested
Hi, I am new to this list. I have a question regarding including both spatial and temporal random factors in lmer. These two are not nested, and an example of model I try to fit is model1<-lmer(Richness~Y+Canopy+Veg_cm+Treatment+(1|Site/Block/Plot)+(1|Year), family=poisson, REML=FALSE), where richness = integer Y & Treatment = factor Canopy & Veg_cm = numerical, continous
2013 Nov 24
1
create a new dataframe with intervals and computing a weighted average for each of its rows
I need you help with this problem, I have a data-frame like this: BHID=c(43,43,43,43,44,44,44,44,44) FROM=c(50.9,46.7,44.2,43.1,52.3,51.9,49.3,46.2,42.38) TO=c(46.7,44.2,43.1,40.9,51.9,49.3,46.2,42.38,36.3) AR=c(45,46,0.0,38.45,50.05,22.9,0,25,9) DF<-data.frame(BHID,FROM,TO,VALUE) #add the length DF$LENGTH=DF$FROM-DF$TO where: + BHID: is the borehole
2009 Jun 30
1
fitting in logistic model
I would like to know how R computes the probability of an event in a logistic model (P(y=1)) from the score s, linear combination of x and beta. I noticed that there are differences (small, less than e-16) between the fitting values automatically computed in the glm procedure by R, and the values "manually" computed by me applying the reverse formula p=e^s/(1+e^s); moreover I noticed
2005 Oct 10
1
interpretation output glmmPQL
Hi ! We study the effect of several variables on fruit set for 44 individuals (plants). For each individual, we have the number of fruits, the number of flowers and a value for each variable. Here is our first model in R : y <- cbind(indnbfruits,indnbflowers); model1 <-glm(y~red*yellow+I(red^2)+I(yellow^2)+densite8+I(densite8^2)+freq8_4+I (freq8_4^2), quasibinomial); - We have
2006 Mar 31
1
model comparison with mixed effects glm
I use model comparison with glms without mixed effects with anova(modelA,modelB), with mixed effects glm (glmmPQL), this doesn't work. Is there a way to compare model fits with glmmPQL's? Paula M. den Hartog Behavioural Biology Institute of Biology Leiden Leiden University [[alternative HTML version deleted]]
2007 Feb 25
1
Repeated measures logistic regression
Dear all, I'm struggling to find the best (set of?) function(s) to do repeated measures logistic regression on some data from a psychology experiment. An artificial version of the data I've got is as follows. Firstly, each participant filled in a questionnaire, the result of which is a score. > questionnaire ID Score 1 1 6 2 2 5 3 3 6 4 4 2 ...
2005 Apr 17
3
generalized linear mixed models - how to compare?
Dear all, I want to evaluate several generalized linear mixed models, including the null model, and select the best approximating one. I have tried glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result in similar parameter estimates but fairly different likelihood estimates. My questions: 1- Is it correct to calculate AIC for comparing my models, given that they use
2009 Feb 11
2
generalized mixed model + mcmcsamp
Hi, I have fitted a generalized linear mixed effects model using lmer (library lme4), and the family = quasibinomial. I have tried to obtain a MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following error which I don't understand at all: Error in .local(object, n, verbose, ...) : Update not yet written traceback() delivers: 4: .Call(mer_MCMCsamp, ans, object) 3:
2008 Feb 20
1
p-value for fixed effect in generalized linear mixed model
Dear R-users, I am currently trying to switch from SAS to R, and am not very familiar with R yet, so forgive me if this question is irrelevant. If I try to find the significance of the fixed factor "spikes" in a generalized linear mixed model, with "site" nested within "zone" as a random factor, I compare following two models with the anova function:
2006 Jan 24
1
fitting generalized linear models using glmmPQL
Hi, I have tried to run the following (I know it's a huge data set but I tried to perform it with a 1 GB RAM computer): library(foreign) library(MASS) library(nlme) datos<-read.spss(file="c:\\Documents and Settings\\Administrador\\Escritorio\\datosfin.sav",to.data.frame=TRUE) str(datos) `data.frame': 1414 obs. of 5 variables: $ POB : Factor w/ 6 levels
2008 Aug 19
1
R vs Stata on generalized linear mixed models: glmer and xtmelogit
Hello, I have compared the potentials of R and Stata about GLMM, analysing the dataset 'ohio' in the package 'faraway' (the same dataset is analysed with GEE in the book 'Extending the linear model with R' by Julian Faraway). Basically, I've tried the 2 commands 'glmmPQL' and 'glmer' of R and the command 'xtmelogit' of Stata. If I'm not
2009 Apr 20
7
Fitting linear models
I am not sure if this is an R-users question, but since most of you here are statisticians, I decided to give it a shot. I am using the lm() function in R to fit a dependent variable to a set of 3 to 5 independent variables. For this, I used the following commands: >model1<-lm(function=PBW~SO4+NO3+NH4) Coefficients: (Intercept) SO4 NO3 NH4 0.01323 0.01968