similar to: nested, repeated measure lme

Displaying 20 results from an estimated 4000 matches similar to: "nested, repeated measure lme"

2008 Nov 06
2
replacing characters in formulae / models
Dear all, How can I replace text in objects that are of class "formula"? y="a * x + b" class(y)="formula" grep("x",y) y[1] Suppose I would like to replace the "x" by "w" in the formula object "y". How can this be done? Somehow, the methods that can be used in character objects do not work 1:1 in formula objects... Many
2007 Nov 08
6
Extract correlations from a matrix
Dear R users, suppose I have a matrix of observations for which I calculate all pair-wise correlations: m=matrix(sample(1:100,replace=T),10,10) w=cor(m,use="pairwise.complete.obs") How do I extract only those correlations that are >0.6? w[w>0.6] #obviously doesn?t work, and I can?t find a way around it. I would very much appreciate any help! Best wishes Christoph (using R
2008 Feb 22
3
Simultaneously summarizing many models
Dear R users, Let?s say I have 10 models, each named m1,m2,m3..., and I would like to summarize them automatically and simultaneously - e.g., to extract parameter estimates later on from all models; how can I do that? I have tried: x=1:10 #this creates some example data y=rnorm(10) m1=lm(x~y) m2=lm(x~1) sum.lms=function(x)summary(paste("m",x,sep="")) sum.lms(1:2) but
2008 Nov 25
4
glm or transformation of the response?
Dear all, For an introductory course on glm?s I would like to create an example to show the difference between glm and transformation of the response. For this, I tried to create a dataset where the variance increases with the mean (as is the case in many ecological datasets): poissondata=data.frame( response=rpois(40,1:40), explanatory=1:40) attach(poissondata) However, I have run into
2008 Aug 22
1
lme questions re: repeated measures & covariance structure
Hello, We are attempting to use nlme to fit a linear mixed model to explain bird abundance as a function of habitat: lme(abundance~habitat-1,data=data,method="ML",random=~1|sampleunit) The data consist of repeated counts of birds in sample units across multiple years, and we have two questions: 1) Is it necessary (and, if so, how) to specify the repeated measure (years)? As written,
2008 Jun 07
1
Multivariate LM: calculating F-values after calling linear.hypothesis
Dear R users, I am analyzing several response variables (all scaled to [0;1]) using a multivariate linear model. After fitting the model, I set up a hypothesis matrix to test specific contrasts for these response variables; for example: "a always increases significantly more than b when regressed against x". What I am stuck with now is how to calculate the correct F-values (and
2008 Jul 03
1
lm() question
I have data that looks like YC Age Num 82 11 2 83 10 0 84 9 8 85 8 21 86 7 49 87 6 18 88 5 79 89 4 28 90 3 273 91 2 175 with a program mod1=lm(log(Num+1)~YC, data=box44) plot(log(Num+1)~YC, data=box44, pch=19, xlab="Year Class", ylab="Loge Number at age", ylim=c(0,6), xlim=c(91,82)) abline(lm(log(Num+1)~YC), col="blue", lwd=2) summary(mod1) I need to
2008 Nov 03
2
standard errors for predict.nls?
Dear all, Is there a way to retrieve standard errors from nls models? The help page tells me that arguments such as se.fit are ignored... Many thanks and best wishes Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germany phone +49 (0)551 39 8807 fax +49 (0)551 39 8806 Homepage http://www.gwdg.de/~cscherb1
2009 Jan 07
1
Extracting degrees of freedom from a gnls object
Dear all, How can I extract the total and residual d.f. from a gnls object? I have tried str(summary(gnls.model)) and str(gnls.model) as well as gnls(), but couldn?t find the entry in the resulting lists. Many thanks! Best wishes Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germany phone +49 (0)551 39 8807 fax +49
2008 Oct 02
1
An AIC model selection question
Dear R users, Assume I have three models with the following AIC values: model AIC df model1 -10 2 model2 -12 5 model3 -11 2 Obviously, model2 would be preferred, but it "wastes" 5 df compared to the other models. Would it be allowed to select model3 instead, simply because it uses up less df and the delta-AIC between model2 and model3 is just 1? Many thanks for any
2007 May 07
4
Mardia's multivariate normality test
Dear all, I got this error message > library(dprep) > mardia(Savg) Error in cov(data) : 'x' is empty But with the same data, I got > library(mvnormtest) > mshapiro.test(Savg) Shapiro-Wilk normality test data: Z W = 0.9411, p-value = 0.6739 What does the error message "Error in cov(data) : 'x' is empty" mean? Thanks a lot! Jiao
2011 Aug 19
1
Windows 7 issues with installing packages and setting library paths
Dear all, I am forced to work in an environment without administrator rights. When using R2.13.1 on Windows 7 (64-Bit), I found that I can?t install or update any packages due to missing writing permissions. I managed to get full access to a directory on my C:\ drive now - but how do I specify that all libraries shall be installed into this directory? In Rcmd_environ I have the following
2008 Jul 24
2
What is wrong with this contrast matrix?
Dear all, I am fitting a multivariate linear model with 7 response variables and 1 explanatory variable. The following matrix P: P <- cbind( c(1,-1,0,0,0,0,0), c(2,2,2,2,2,-5,-5), c(1,0,0,-1,0,0,0), c(-2,-2,0,-2,2,2,2), c(-2,1,0,1,0,0,0), c(0,-1,0,1,0,0,0)) should consist of orthogonal elements (as can be shown using %*% on the individual columns). However, when I use
2008 Oct 01
0
Minimizing both AIC and df in model selection
Dear R users, Suppose I have a set of 10 candidate models, and these all differ by a delta-AIC of 5. Would it be sensible, then, to choose the best-fit model as the one that has *both* minimal AIC *and* minimal number of d.f.? Are there any references for such an approach? Many thanks for your help! Best wishes, Christoph -- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW,
2012 Jul 20
1
Creating a pdf with layers?
Dear all, Is it possible to create a pdf file with layers using the pdf() device in R? Many thanks for your help! Christoph (using R 2.15.1 on Windows 7 64-Bit) -- PD Dr Christoph Scherber Georg-August University Goettingen Department of Crop Science Agroecology Grisebachstrasse 6 D-37077 Goettingen Germany phone 0049 (0)551 39 8807 fax 0049 (0)551 39 8806 http://www.gwdg.de/~cscherb1
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(),
2007 Sep 14
0
lme for repeated measurements over time
Hi list I am just beginning to understand the complexities of linear mixed effects models. Maybe someone can give advise concerning the following problem: I have two groups of surgical patients in which repeated laboratory measurements were taken over time after surgery. I decided that lme would be the best model to fit the data. I already fitted the model lme(logratio ~ gr*I(pod-10) +
2011 Oct 05
2
subplot strange behavoir
Hello, Below is some example code that should reproduce an error I'm encountering while trying to create a tiff plot with two subplots. If I run just the following bit of code through the R GUI the result is what I'd like to have appear in the saved tiff image: x<-seq(0:20) y<-c(1,1,2,2,3,4,5,4,3,6,7,1,1,2,2,3,4,5,4,3,6) plot(x,y,type="l",las=1,ylim=c(0,12))
2008 Mar 20
4
little subplot in corner
I want to draw a little subplot ("overview") into my detailed plot. It should be placed in say the top right corner and have the size of some legend (like legend(x="topright", inset=0.03, ...) #main plot plot(rnorm(100)) #give little density in corner plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type="l") I don't want something like par(mfrow=c(1,2)) as
2010 Nov 18
1
lme Random Effects and Covariates
1. I'm attempting to test for Random Effects. I've grouped the data on subject (grid) but want to use lme to build the model without subject as a RE then add it and do anova between the 2 models. This is the result I get and it appears it's adding Random Effects. tmp.dat4 <- groupedData(Trials ~ 1 | grid, data = tmp.dat4) mod2a <- lme(Trials ~ factor(group_id) + reversal,