[R] weights in GAMs (package mgcv)
jmburgos at u.washington.edu
Tue Aug 14 18:45:00 CEST 2007
I’m using the ‘mgcv’ package to fit some GAMs. Some of my covariates are
derived quantities and have an associated standard error, so I would
like to incorporate this uncertainty into the GAM estimation process.
Ideally, during the estimation process less importance would be given to
observations whose covariates have high standard errors.
The gam() function in the ‘mgcv’ package has a ‘weights’ argument.
According to the package documentation, this can be used to provide
prior weights to the data. This argument (as far as I understand) takes
a vector of the same length of the data with numeric values higher than
zero. So it seems that I should combine the standard errors of all
covariates into a single vector and use it as weights. But it is not
obvious to me how to do this, given that the covariates have different
units and ranges of values.
Is there any way to provide weights to the covariates directly (for
example providing a matrix of n x m values, where n=number of covariates
and m=number of observations)?
Julian M. Burgos
Fisheries Acoustics Research Lab
School of Aquatic and Fishery Science
University of Washington
1122 NE Boat Street
Seattle, WA 98105
More information about the R-help