similar to: predict.gls choking on levels of factor

Displaying 20 results from an estimated 2000 matches similar to: "predict.gls choking on levels of factor"

2006 Mar 07
1
lme and gls : accessing values from correlation structure and variance functions
Dear R-users I am relatively new to R, i hope my many novice questions are welcome. I have problems accessing some objects (specifically the random effects, correlation structure and variance function) from an object of class gls and lme. I used the following models: yah <- gls (outcome~ -1 + as.factor(Trial):as.factor(endpoint)+
2010 Jun 24
1
Question on WLS (gls vs lm)
Hi all, I understand that gls() uses generalized least squares, but I thought that maybe optimum weights from gls might be used as weights in lm (as shown below), but apparently this is not the case. See: library(nlme) f1 <- gls(Petal.Width ~ Species / Petal.Length, data = iris, weights = varIdent(form = ~ 1 | Species)) aa <- attributes(summary(f1)$modelStruct$varStruct)$weights f2 <-
2007 May 21
1
can I get same results using lme and gls?
Hi All I was wondering how to get the same results with gls and lme. In my lme, the design matrix for the random effects is (should be) a identity matrix and therefore G should add up with R to produce the R matrix that gls would report (V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H (V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
2011 Aug 17
1
contrast package with interactions in gls model
Hi! I try to explain the efffect of (1) forest where i took samples's soils (* Lugar*: categorical variable with three levels), (2) nitrogen addition treatments (*Tra*: categorical variable with two levels) on total carbon concentration's soil samples (*C: *continue* *variable) during four months of sampling (*Time:* categorical and ordered variable with four levels). I fitted the
2004 Oct 08
1
nlme vs gls
Dear List: My question is more statistical than R oriented (although it originates from my work with nlme). I know statistical questions are occasionally posted, so I hope my question is relevant to the list as I cannot turn up a solution anywhere else. I will frame it in the context of an R related issue. To illustrate the problem, consider student achievement test score data with multiple
2005 Jun 15
1
anova.lme error
Hi, I am working with R version 2.1.0, and I seem to have run into what looks like a bug. I get the same error message when I run R on Windows as well as when I run it on Linux. When I call anova to do a LR test from inside a function, I get an error. The same call works outside of a function. It appears to not find the right environment when called from inside a function. I have provided
2011 Apr 11
3
multiple comparisons with generalised least squares
Dear R users, I have used the following model: M1 <- gls(Nblad ~ Concentration+Season + Concentration:Season, data=DDD, weights=varIdent(form=~ 1 | Season*Concentration)) to assess the effect of Concentration and Season on nitrogen uptake by leaves (Nblad). I accounted for the difference in variance across the factor levels by using the varIdent function. Then I wanted to perform multiple
2009 Apr 01
3
Fit unequal variance model in R
I'am trying to develop some code if R, which would correspond to what I did in SAS. The data look like: Treatment Replicate group1 GSI Control A 1 0.81301 Control B 1 1.06061 Control C 1 1.26350 Control D 1 0.93284 Low A 2 0.79359 Low B
2005 Nov 03
1
Fitting heteroscedastic linear models/ problems with varIdent of nlme
Hi, I would like to fit a model for a factorial design that allows for unequal variances in all groups. If I am not mistaken, this can be done in lm by specifying weights. A function intended to specify weights for unequal variance structures is provided in the nlme library with the varIdent function. Is it apropriate to use these weights with lm? If not, is there another possibility to do
2011 Jul 28
1
Help Non-sequential ANOVAs
Hello, I have data on the maturity of two morphs of fish. I want to test whether their maturity is evolving differently or not on a temporal scale (month). The maturity variable (independent variable) is continuous and the morph and month variables (dependant variables) are categorical. Because the data show variance heterogeneity, I modeled it with the function gls: kg1 =
2012 May 02
3
Consulta gráfica
  Hola,   Por favor, ¿podríais indicarme qué recursos (librerías o ideas) pueden resultar de utilidad para crear un gráfico del estilo del de la figura 3.8 del siguiente link?   http://www.tsc.uvigo.es/BIO/Bioing/ChrLDoc3.html#3.5   Actualmente estoy utilizando funciones muy básicas y la verdad es que no me encuentro muy satisfecha con el resultado.   Muchas gracias.   Eva [[alternative HTML
2006 Nov 13
3
For MacBook, best way to do R?
I'm getting a MacBook and I'd like to stick with OS X rather than convert it to Linux just yet. However, my main concern is having decent performance. What's my best option: *use the existing binary for R? *compile R fresh under OS X? * install Linux and run R under that? Does anyone have any recent experience they can share? Thanks! -- I can answer any question. "I
2003 Mar 14
0
gls with "crossed heteroscedasticity"
Dear All, I am using the function gls (in the nlme package) and I would like to fit a heteroscedastic model, with different variances for each of the levels of two stratification variables. In p. 210 of Pinheiro & Bates ("Mixed effects models in S and S-Plus", 2000, Springer), the authors show the use of the "*" operator. However, that is not what I want, because it
2006 Sep 28
2
safe prediction from lm
I am fitting a regression model with a bs term and then making predictions based on the model. According to some info on the internet at http://www.stat.auckland.ac.nz/~yee/smartpred/DummiesGuide.txt there are some problems with using predict.lm when you have a model with terms such as bs,ns,or poly. However when I used one of the examples they said would illustrate the problems I get virtually
2009 Sep 23
1
any advice on web interfaces to R?
I saw http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Web-Interfaces and I'm still not sure yet which platform (Linux, Windows, etc.) I'll be working on -- and no, it's not under my control to pick. I was wondering if anyone out there had good advice, that would save me time and stomach acid, on how to set up a web browser to send a list of commands to an R and put the resulting table
2011 Jan 27
4
HLM Model
Hi I am trying to convert SAS codes to R, but some of the result are quite different from SAS. When I ran proc mixed, I have an option ddfm=bw followed by the model. How can I show this method in R?(I am thinking that this maybe the reason that I can't get the similar results) below is my SAS codes: proc mixed data=test covtest empirical; class pair grade team school; model score = trt
2009 Mar 04
0
'anova.gls' in 'nlme' (PR#13567)
There is a bug in 'anova.gls' in the 'nlme' package (3.1-90). The=20 bug is triggered by calling the function with a single 'gls' object=20 and specifying the 'Terms' argument but not the 'L' argument: > library(nlme) > fm1Orth.gls <- gls(distance ~ Sex * I(age - 11), Orthodont, + correlation =3D corSymm(form =3D ~ 1 |
2009 Feb 02
0
repeated measures with gls
I am using the gls function of the nlme package to analyze data sets of soil respiration which have the following design: 3 complete blocks x 5 sampling dates (time from fertilization) x 3 fertilization levels. The fertilization dates are equal for all subjects (blocks) but not periodical (-46, 10, 24, 53, 123 days from the event). The code that I've been using is: fit.csnC<- gls(dno.C
2005 Oct 13
0
nlme gls() error
Hello I'm fitting a gls model with a variance-covariance structure and an getting an error message I don't understand I'm using gls() from the nlme library with the structure defined by correlation = corSymm(form = ~1|Subject), weights = varIdent(form=~1|strata) I get the error Error in recalc.corSymm(object[[i]], conLin) : NA/NaN/Inf in foreign function call (arg 1) My
2010 Jun 18
2
varIdent error using gam function in mgcv
Hello, As I am relatively new to the R environment this question may be either a) Really simple to answer b) Or I am overlooking something relatively simple. I am trying to add a VarIdent structure to my gam model which is fitting smoothing functions to the time variables year and month for a particular species. When I try to add the varIdent weights to variable Month I get this error returned.