[R] Help converting a function from S-Plus to R: family$weight

From: Peter Dunn <dunn_at_usq.edu.au>
Date: Fri 12 Aug 2005 - 14:14:09 EST

Hi all

I am converting an S-Plus function into R. The S-Plus code uses some of the glm families, and family objects.

The family objects in S-Plus and R have many different features, for example:

In R:
> names(Gamma())

  [1] "family"     "link"       "linkfun"    "linkinv"    "variance"
  [6] "dev.resids" "aic"        "mu.eta"     "initialize" "validmu"
[11] "valideta"

In S-Plus:
> names(Gamma())

[1] "family" "names" "link" "inverse" "deriv" [6] "initialize" "variance" "deviance" "weight"

My question concerns the variable weight in the S-Plus function. I'm not sure what it is. (I have searched the S-Plus mailing list archive, and my "S-Plus for linux 6.1" documentation.) For almost all family objects, the weight variable is the same as variance, just weighted (and the former as a function; the later as an expression):

> Gamma()$variance

> Gamma()$weight

expression(w * mu^2.)

The same applies for most families. So I thought I could determine what this weight variable was.

But alas--not the inverse,gaussian:

> inverse.gaussian()$variance

> inverse.gaussian()$weight

expression(w/((sqrt(family$variance(mu)) * family$deriv(mu))^2.))

- can anyone tell me what this expression weight represents? - why is the inverse.gaussian family different than all others?

Thanks in advance.


My S-Plus version:

> version

Version 6.2.1 for Linux 2.4.18 : 2003

My R version:

> version

platform i386-pc-linux-gnu

arch     i386
os       linux-gnu

system i386, linux-gnu
major 2
minor 1.0
year 2005
month 04
day 18
language R
Dr Peter Dunn  |  Senior Lecturer in Statistics
Faculty of Sciences, University of Southern Queensland
   Web:    http://www.sci.usq.edu.au/staff/dunn
   Email:  dunn <at> usq.edu.au
CRICOS:  QLD 00244B |  NSW 02225M |  VIC 02387D |  WA 02521C

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Aug 12 14:15:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:47 EST