similar to: Question on WLS (gls vs lm)

Displaying 20 results from an estimated 2000 matches similar to: "Question on WLS (gls vs lm)"

2003 Mar 31
1
nonpos. def. var-cov matrix
R 1.6.2 for Windows, Win2k: I have fitted a weighted least squares model using the code "wls.out <- gls(y ~ x1 + x2 + x3 + x4 + x5 + x6 - 1, data = foo.frame, weights = varConstPower(form = ~ fitted(.), fixed = list(power = 0.5), const = 1))" The data has 62 rows and the response is zero when the covariates are zero. The purpose of the model was to account for the the fact that
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
2006 Jul 13
1
ols/gls or systemfit (OLS, WLS, SUR) give identical results
I might be sorry for asking this question :-) I have two equations and I tried to estimate them individually with "lm" and "gls", and then in a system (using systemfit) with "OLS", "WLS" and "SUR". Quite surprisingly (for myself at least) the results are identical to the last digit. Could someone (please!) give a hint as to what am I
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 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
2006 Jan 09
1
trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
I have been using gnls with the weights argument (and varConstPower) to specify a variance structure for curve fits. In attempting to extract the parameters for the variance model I am seeing results I don't understand. When I simply display the model (or use "summary" on the model), I get what seem like reasonable values for both "power" and "const". When I
2007 Jun 25
3
Bug in getVarCov.gls method (PR#9752)
Hello, I am using R2.5 under Windows. Looks like the following statement vars <- (obj$sigma^2)*vw in getVarCov.gls method (nlme package) needs to be replaced with: vars <- (obj$sigma*vw)^2 With best regards Andrzej Galecki Douglas Bates wrote: >I'm not sure when the getVarCov.gls method was written or by whom. To >tell the truth I'm not really sure what
2006 Jun 01
2
Help: lme
Good day R-Users, I have a problem accessing some values in the output from the summary of an lme fit. The structure of my data is as shown below (I have attached a copy of the full data). id trials endp Z.sas ST 1 1 -1 -1 42.42884 1 1 1 -1 48.12007 2 1 -1 -1 43.42878 2 1 1 -1
2010 Oct 15
2
How to extract parameter estimates of variance function from lme fit
Dear R-Users, I have a question concerning extraction of parameter estimates of variance function from lme fit. To fit my simulated data, we use varConstPower ( constant plus power variance function). fm<-lme(UPDRS~time,data=data.simula,random=~time,method="ML",weights=varConstPower(fixed=list(power=1))) I extract the results of this function by using the following codes:
2006 May 30
1
Query: lme output
Dear R-Users I have a problem accessing some values in the output from the summary of an lme fit. I fit the model below: ggg <- lme (ST~ -1 + as.factor(endp):Z.sas + as.factor(endp), data=dat4a, random=~-1 + as.factor(endp) + as.factor(endp):Z.sas|as.factor(trials), correlation = corSymm(form=~1|as.factor(trials)/as.factor(id)), weights=varIdent(form=~1|endp)) hh
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
2009 Sep 01
1
understanding the output from gls
I'd like to compare two models which were fitted using gls, however I'm having trouble interpreting the results of gls. If any of you could offer me some advice, I'd greatly appreciate it. Short explanation of models: These two models have the same fixed-effects structure (two independent, linear effects), and differ only in that the second model includes a corExp structure for
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
2004 Oct 28
0
Auxilliary args in gls
I am trying to fit a B-spline regression model with a corStruct using gls. I am using bs() and specifying the knots myself. If I make the knots data-dependent, this works but has undesirable side-effects. I prefer to reference an auxilliary variable "knots" in my model formula. It should not be part of the data frame, as it is a vector of a different length. How can this be done? The
2006 Nov 09
1
Extracting the full coefficient matrix from a gls summary?
Hi, I am trying to extract the coefficients matrix from a gls summary. Contrary to the lm function, the command fit$coefficients returns only the estimates of the model, not the whole matrix including the std errors, the t and the p values. example: ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14) trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69) group <-
2007 May 18
0
gls() error
Hi All How can I fit a repeated measures analysis using gls? I want to start with a unstructured correlation structure, as if the the measures at the occations are not longitudinal (no AR) but plainly multivariate (corSymm). My data (ignore the prox_pup and gender, occ means occasion): > head(dta,12) teacher occ prox_self prox_pup gender 1 1 0 0.76 0.41 1 2
2004 Apr 05
3
2 lme questions
Greetings, 1) Is there a nice way of extracting the variance estimates from an lme fit? They don't seem to be part of the lme object. 2) In a series of simulations, I am finding that with ML fitting one of my random effect variances is sometimes being estimated as essentially zero with massive CI instead of the finite value it should have, whilst using REML I get the expected value. I guess
2005 Mar 21
1
Convert numeric to class
Dear all, I have a script about iteration classification, like this below data(iris) N <- 5 ir.tr.iter <- vector('list',N) ir.tr <- vector('list',N) for (j in 1:N) { ir.tr[[j]] <- rpart(Species ~., data=iris) ir.tr.iter[j] <- ir.tr[[j]]$frame result <- list(ir.tr=ir.tr, ir.tr.iter=ir.tr.iter) } as.data.frame(as.matrix(ir.tr.iter))
2006 Jul 13
1
Extracting Phi from gls/lme
I am trying to extract into a scalar the value of Phi from the printed output of gls or lme using corAR1 correlation. ie I want the estimate of the autocorrelation. I can't see how to do this and haven't seen it anywhere in str(model.lme). I can get all the other information - fixed and random effects etc. Is there an obvious way so that I can save the brick wall some damage? TIA