Re: [R] WLS in R

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 19 May 2006 - 15:42:49 EST

This is not really weighted least squares, since the weights depend on the parameters beta_*: WLS refers to pre-specified weights and can be done by lm().

It looks very like an approximation to logistic regression, which can be fitted by glm. But fits for this model can be done by nls (see the example using Weighted.MM) or by direct optimization of the criterion.

On Thu, 18 May 2006, Karabi Sinha wrote:

>
> Can anyone offer any help with coding the following in R?
>
> I want to find (and store) Weighted Least Squares estimates of the
> regression parameters for the following model:
>
> z_i = beta_0 + beta_1.x_i + e_i; i=1,2,...,m
>
> where e ~ N[0, 1/(ni.pi.(1-pi))], sum(ni)=n
>
> and pi = exp(beta_0+beta_1.x_i)/[1+exp(beta_0+beta_1.x_i)].
>
> Any help on this will be greatly appreciated.
>
> Sincerely,
>
> Karabi Sinha, Ph.D.
> Assistant Professor of Biostatistics
> Division of Epidemiology and Biostatistics
> University of Illinois at Chicago
> 1603 W Taylor, Rm 951
> Chicago, IL 60612
> Phone: (312) 355-3611
> Fax : (312) 996-0064
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri May 19 15:47:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 May 2006 - 18:10:11 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.