Re: [R] sample weights in ols

From: Thomas Lumley <tlumley_at_uw.edu>
Date: Thu, 12 May 2011 08:17:39 +1200

On Thu, May 12, 2011 at 2:43 AM, jour4life <jour4life_at_gmail.com> wrote:
> I have a follow up question. When using svyglm, it does not matter that I am
> not using survey design and only weights?
> In other words,
>
> fit<-svyglm(y~x1+x2+...xk,data=dataset,weights=weightvariable)
>
> Or am I going to have to construct a survey design variable, using only the
> weight variable?

You will have to construct a survey design. It's not difficult.

my.first.survey.design <- svydesign(id=~1, weights=~weightvariable, data=dataset)

fit<-svyglm(y~x1+x2+...xk, design=my.first.survey.design)

   -thomas

-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 11 May 2011 - 20:21:04 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 12 May 2011 - 03:20:07 GMT.

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

list of date sections of archive