similar to: what does it mean when "lm.gls" says that the weight matrix has wrong dimension?

Displaying 20 results from an estimated 5000 matches similar to: "what does it mean when "lm.gls" says that the weight matrix has wrong dimension?"

2006 Mar 13
1
P-values in gls
When fitting a simple linear or polynomial regression using lm, R provides a p-value for the whole model as well as for the individual coefficients. When fitting the same models using gls (in order to correct for autocorrelation), there doesn't seem to be a p-value provided for the whole model, although LL, AIC and BIC statistics are provided. Is it possible to obtain a p-value for the whole
2005 Apr 15
1
AR1 in gls function
Dear R-project users I would like to calculate a linear trend versus time taking into account a first order autoregressive process of a single time series (e.g. data$S80 in the following example) using th gls function. gls(S80 ~ tt,data=data,corAR1(value, form, fixed)) My question is what number to set in the position of value within corAR1? Should it be the acf at lag 1? I look forward for
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
2006 Mar 16
2
DIfference between weights options in lm GLm and gls.
Dear R-List users, Can anyone explain exactly the difference between Weights options in lm glm and gls? I try the following codes, but the results are different. > lm1 Call: lm(formula = y ~ x) Coefficients: (Intercept) x 0.1183 7.3075 > lm2 Call: lm(formula = y ~ x, weights = W) Coefficients: (Intercept) x 0.04193 7.30660 > lm3 Call:
2010 Mar 15
0
question regarding variance function in gls
Dear R-help members, I have a question regarding how to use varComb function to specify a variance function for the "weights" in the gls. I need to fit a linear model with heteroscedasticity. The variance function is exp(c0+nu0*W +nu1*W^2) where W is a covariate. Initially I want to use varFunc to define my own variance function following the instruction in the Pinheiro and Bates
2010 Mar 09
0
varComb in gls/lme
Dear R-help members, I have a question regarding how to use varComb function to specify a variance function for the "weights" in the gls. I need to fit a linear model with heteroscedasticity. The variance function is exp(c0+nu0*W +nu1*W^2) where W is a covariate. Initially I want to use varFunc to define my own variance function following the instruction in the Pinheiro and
2012 Apr 19
2
Gls function in rms package
Dear R-help, I don't understand why Gls gives me an error when trying to fit a model with AR(2) errors, while gls (from nlme) does not. For example: library(nlme) library(rms) set.seed(1) d <- data.frame(x = rnorm(50), y = rnorm(50)) gls(y ~ x, data=d, correlation = corARMA(p=2)) #This works Gls(y ~ x, data=d, correlation = corARMA(p=2)) # Gives error # Error in
2006 Aug 09
1
Joint confidence intervals for GLS models?
Dear All, I would like to be able to estimate confidence intervals for a linear combination of coefficients for a GLS model. I am familiar with John Foxton's helpful paper on Time Series Regression and Generalised Least Squares (GLS) and have learnt a bit about the gls function. I have downloaded the gmodels package so I can use the estimable function. The estimable function is very
2003 Sep 25
1
Error from gls call (package nlme)
Hi I have a huge array with series of data. For each cell in the array I fit a linear model, either using lm() or gls() with lm() there is no problem, but with gls() I get an error: Error in glsEstimate(glsSt, control = glsEstControl) : computed gls fit is singular, rank 2 as soon as there are data like this: > y1 <- c(0,0,0,0) > x1 <- c(0,1,1.3,0) > gls(y1~x1)
2009 Sep 22
1
odd (erroneous?) results from gls
A couple weeks ago I posted a message on this topic to r-help, the response was that this seemed like odd behavior, and that I ought to post it to one of the developer lists. I posted to r-sig-mixed-models, but didn't get any response. So, with good intentions, I decided to try posting once more, but to this more general list. The goal is (1) FYI, to make you aware of this issue, in case it
2003 Oct 24
2
NLME: gls parameter evaluation inconsistency (PR#4757)
Full_Name: W.B.Kloke Version: 1.8.0 OS: FreeBSD-4.7 Submission from: (NULL) (195.253.22.63) I found a parameter evaluation inconsistency in NLME package. I tried to use gls() inside a function, and I wanted use gls() for different subsets of a data frame: prgls <- function(name){ gls( log10(Y)~(cond-1)+(cond-1):t ,pr,subset=subject==name)} Applying this function with a string as parameter
2010 May 28
1
latex.rms and models fit with GLS
Hi, I have fit a model using the rms package with the Gls() function. Is there a way to get the model estimates, std errors, and p-values (i.e. what you get with print(fit)) into latex format? I have tried: f <- Gls(...) latex(f, file='') ... but I get the following error Error in replace.substring.wild(s, old, new, test = test, front = front, : does not handle > 1 * in
2010 Jan 07
1
faster GLS code
Dear helpers, I wrote a code which estimates a multi-equation model with generalized least squares (GLS). I can use GLS because I know the covariance matrix of the residuals a priori. However, it is a bit slow and I wonder if anybody would be able to point out a way to make it faster (it is part of a bigger code and needs to run several times). Any suggestion would be greatly appreciated. Carlo
2008 May 09
1
Which gls models to use?
Hi, I need to correct for ar(1) behavior of my residuals of my model. I noticed that there are multiple gls models in R. I am wondering if anyone has experience in choosing between gls models. For example, how should one decide whether to use lm.gls in MASS, or gls in nlme for correcting ar(1)? Does anyone have a preference? Any advice is appreciated! Thanks, -- Tom [[alternative HTML
2010 Mar 09
1
Computation of AIC for gls models
Dear Colleagues, We are using the phylog.gls.fit() function from the R package "PHYLOGR" (Diaz-Uriarte R, Garland T: PHYLOGR: Functions for phylogenetically based statistical analyses. 2007. Available at [http://cran.r-project.org/web/packages/PHYLOGR/index.html]) to correct for lack of independence between data points. (In our particular case, the lack of independence is due to
2005 Nov 17
1
anova.gls from nlme on multiple arguments within a function fails
Dear All -- I am trying to use within a little table producing code an anova comparison of two gls fitted objects, contained in a list of such object, obtained using nlme function gls. The anova procedure fails to locate the second of the objects. The following code, borrowed from the help page of anova.gls, exemplifies: --------------- start example code --------------- library(nlme) ##
2009 Jan 28
1
gls prediction using the correlation structure in nlme
How does one coerce predict.gls to incorporate the fitted correlation structure from the gls object into predictions? In the example below the AR(1) process with phi=0.545 is not used with predict.gls. Is there another function that does this? I'm going to want to fit a few dozen models varying in order from AR(1) to AR(3) and would like to look at the fits with the correlation structure
2011 May 21
1
predict.gls choking on levels of factor
I've got a gls formula that's a mix of continuous and ordered variables. I wanted to use gls because I wanted to use the varIdent structure. Anyway, attempts to use "predict.gls" choke with the error that the levels I use are not allowed for one of them -- the first one alphabetically, so I'd guess the second would have the same problem. So I have three linked questions --
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
2003 Aug 01
1
gls function
Dear all I use the gls function but in contrast to the lm function in which when I type summary(lm(...))$coef I receive all the coefficients (estimate, Std. Error, t-value and pvalue), with gls when I type summary(gls(...))$coef I only receive the estimate of the reg. coefficient without std. error and t- and p-values. Dou you have any suggestion how to solve my problem? With kind regards