search for: varfunc

Displaying 20 results from an estimated 31 matches for "varfunc".

2009 Feb 24
1
Initialize varFunc in R
...nction in the model: model1 <- update(model0, weights=varIdent(form = ~1|species.group) ) I got no error message or note but when I printed model1 the output did not print any variance structure. It just didn't add any weights or variance structure and model1 = model0 If instead I ran the varFunc sepparately: varf1 <- varIdent(form = ~1|species.group) varf.init <- Initialize(varf1, data) model1 <- update(model0, weights=varf.init ) it works just fine, and I get an output with "Variance function: Structure: Different standard deviations per stratum" and a change in the d...
2004 Oct 03
1
creating new varFunc classes in nlme .. error: "Don't know how to get coefficients for .. object"
Hello. I am trying my hand at modifying the varFunc class varExp, but I must be missing a step. All I want to do right now is make a working copy of varExp, call it varExp2, and then later change it. coef.varExp2, coef<-.varExp2, and Initialize.varExp2 all seem to work properly after I construct them. I can successfully use the commands: v2 &...
2005 Mar 09
0
need help getting started writing a new varFunc class for lme()
Hello - I've been using R for years, but have always been able to find what I need already available. Now I find that I would like to write a new varFunc class for the lme() or nlme() packages. There is some guidance for this in Problem 4 Chapter 5 of Bates and Pinheiro Mixed Effects Models in S and S-Plus. However, I find that I am unable to even get started and so have just purchased John Chambers Book - Programming with Data, A Guide to the...
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(),
2006 Jan 09
1
trouble with extraction/interpretation of variance structure para meters from a model built using gnls and varConstPower
...power = .8913665 summary(model3); #const = .6551298, power = .8913665 coef(model3$modelStruct$varStruct)["power"]; # power = .8913665 coef(model3$modelStruct$varStruct)["const"]; #const = -0.4229219 coef.varFunc(model3$modelStruct$varStruct); #R can't seem to find this function, Splus can Any advice on what I am doing wrong would be appreciated. Hugh Rand Senior Scientist Amgen rand at amgen.com
2006 Feb 17
0
trouble with extraction/interpretation of variance struct ure para meters from a model built using gnls and varConstPower
...oef(model3$modelStruct$varStruct)["const"]) const 0.6551298 Does that answer the question about not understanding the connection between summary(model3) and coef(model3$modelStruct$varStruct)["const"]? Regarding the question about R not being able to find 'coef.varFunc', I tried the following: > methods("coef") <snip> coef.varFunc* [37] coef.varIdent* coef.varPower* Non-visible functions are asterisked Since "coef.varFunc" is "asterisked", I tried 'getAnywhere(coef.varFunc)'. I walked throu...
2002 Aug 29
8
lme() with known level-one variances
Greetings, I have a meta-analysis problem in which I have fixed effects regression coefficients (and estimated standard errors) from identical models fit to different data sets. I would like to use these results to create pooled estimated regression coefficients and estimated standard errors for these pooled coefficients. In particular, I would like to estimate the model \beta_{i} = \mu +
2017 Mar 07
0
Potential clue for Bug 16975 - lme fixed sigma - inconsistent REML estimation
...0-34 #Package: nlme #Version: 3.1-131 library(nlme) library(sae) ####* varSum, a modification of varComb to make the combination additive instead of multiplicative varSum <- ## constructor for the varSum class function(...) { val <- list(...) if (!all(unlist(lapply(val, inherits, "varFunc")))) { stop("all arguments to 'varSum' must be of class \"varFunc\".") } if (is.null(names(val))) { names(val) <- LETTERS[seq_along(val)] } class(val) <- c("varSum","varComb", "varFunc") val } varWeights.varSum <- fu...
2001 Dec 27
1
gls
A couple of questions: How to be sure that gls allowes errors to be correlated and/or have unequal variances? (is this on auto or is there a switch?) How to calculate confidence limits for a linear regresssion? -------------- next part -------------- A non-text attachment was scrubbed... Name: dthompson.vcf Type: text/x-vcard Size: 303 bytes Desc: Card for David Thompson Url :
2002 Mar 12
0
Case weights in nlme models
...All this is fine, and I've been able to run linear models on the data using lm() with the weights = WT2517 option (WT2517 is the column containing the weight variable). But the documentation for nlme() suggests that weights= takes something other than a straight vector: weights: an optional `varFunc' object or one-sided formula describing the within-group heteroscedasticity structure. If given as a formula, it is used as the argument to `varFixed', corresponding to fixed variance weights. See the documentation on `varClasses' for a descriptio...
2006 Jul 17
1
Variance functions in package nlme
...o produce message pasted as well): library("nlme") data("Orthodont") vf1Ident <- varIdent( c(Female = 0.5), form = ~ 1 | Sex ) vf1Ident <- initialize(vf1Ident, Orthodont) Error in getClass(Class) : c("\"varIdent\" is not a defined class", "\"varFunc\" is not a defined class") In addition: Warning message: the condition has length > 1 and only the first element will be used in: if (!is.na(match(Class, .BasicClasses))) return(newBasic(Class, Can anybody give me a hint, what's going wrong here? Thanks a lot, Thilo Reference...
2012 Mar 21
1
nlme error on dimensions in multiplication
Hello R users, When trying to fit a nonlinear mixed model to a respiration time series, I get the following error message: Error in recalc.varFunc(object[[i]], conLin) : dims [product 30] do not match the length of object [34] In addition: Warning message: In conLin$Xy * varWeights(object) : longer object length is not a multiple of shorter object length Below is an example that generates this message on Windows XP R 2.14.0 nlme 3.1-103...
2005 Jul 26
1
evaluating variance functions in nlme
...looked at Initialize.gnls, summary etc. but it is not clear to me how to evaluate the form component, especially in the case of fit above where form=~fitted(.), in any safe way. I can grep for "fitted" in the formula eg. grep("fitted",deparse(getCovariateFormula(fit$modelStruct$varFunc))) and try to calculate predicted values from the model for the new points but how to substitute back in the new terms? I don't need this problem solved on a platter, I just need to unedrstand an approach, because my stabs are failing. Thanks Nicholas
2012 Aug 07
1
Which R function for GLMM with binary response, nested random factors with temporal correlation?
...liable p values, model selection seems impossible! So my question is: 1) are there any other functions which are suitable for a GLMM with multilevel nested random effects and a AR1 correlation structure? Or is MCMC the only option? 2) to make things more complicated, I'd also like to include a varFunc variance structure to cope with heterogeneity. Is this possible in ML methods in R? I'd also like to extend to a multinomial response at a later stage. GEE seems the best bet, but I come unstuck with the three-way nested factors. Thanks for your help.
2006 Apr 24
1
Modelling heteroskedasticity in a multilevel model
...presumably increase variance of level-1 residuals. On the other hand, industry-level attributes may also affect the relative relative size of firm-level permanent effects (represented by level-2 residuals) Do you know how could I model such a residual structure in R? I have been looking at the varfunc command in the nlme package, but I am not sure if such a function can perform the kind of analysis I actually need. Thank you very much in advance, Antonio _________________________________________________________________ ?Est?s pensando en cambiar de coche? Todas los modelos de serie y extras...
2005 Dec 27
2
glmmPQL and variance structure
...weights, Formula: ~invwt". The script shows that the function varFixed() is used, though the place where 'invwt' is defined remains unclear to me. I wonder if there is an easy way to specify another variance structure (eg varPower, etc..), preferably using an lme object of the varFunc classes ? Some trials show that the 'weights' argument of glmmPQL is just the same as in glm (which is clearly stated in the help) and I wonder actually, if not a nonsense, how to pass eg a 'weights' arguments as used in lme (eg weights=varPower()) to specify a variance function...
2007 Jun 10
1
{nlme} Multilevel estimation heteroscedasticity
...lerance doesn't help. I think the origin of this problem lies within the large number of categories on "schavg" (65), that may make estimation troublesome. This leads to my two questions: - How to solve this estimation-problem? - Is is possible that the varIdent (or more general: VarFunc) of lme returns a single value, representing a coëfficiënt along which variance is increasing / decreasing? - In general: how can a variance-component / heteroscedasticity be made dependent on some level-2 variable (school level in my examples) ? Many thanks in advance, Rense Nieuwenhuis...
2004 Dec 29
3
gls model and matrix operations
...ar.mat<-getVarCov(fm1) I<-diag(1,sample.size) # The following 2 steps are needed to make V conformable for multiplication later V<-kronecker(I,var.mat) I then need to modify the V matrix and then reestimate the gls() by brute force using matrix operations. None of the current corClass or varFunc options would work for my current application, which is why I am doing this manually for now. For reasons outside the scope of this email, I don't show that code or reasons why. Here is the code for brute force GLS which should replicate the estimates obtained from the built in gls function:...
2004 Jul 05
1
"make" error for R-1.9.1
...8 system. I get the following error after "tar -xvzf R-1.9.1.tgz ; cd ./R-1.9.1/ ; ./configure" and "make" : [make works for 10 minutes ... snip ...] varExp text html latex varFixed text html latex varFunc text html latex varIdent text html latex varPower text html latex varWeights text html latex varWeights.glsStruct text html latex varWeights.l...
2004 Oct 28
0
Auxilliary args in gls
...uld not be part of the data frame, as it is a vector of a different length. How can this be done? The gls() code suggests it may be difficult to keep the auxillary arg out of the model.frame but in the evaluation frame of the formula: glsSt <- glsStruct(corStruct = correlation, varStruct = varFunc(weights)) mfArgs <- list(formula = asOneFormula(formula(glsSt), model, groups), data = data, na.action = na.action) if (!missing(subset)) { mfArgs[["subset"]] <- asOneSidedFormula(Call[["subset"]])[[2]] } mfArgs$drop.unused.levels <- TRU...