[R] regression with proportion data

Peter Ehlers ehlers at ucalgary.ca
Mon Mar 19 20:19:53 CET 2012

On 2012-03-19 07:35, S Ellison wrote:
>> -----Original Message-----
>> From: r-help-bounces at r-project.org
>> [mailto:r-help-bounces at r-project.org] On Behalf Of Georgiana May
>> Sent: 19 March 2012 14:06
>> To: r-help at r-project.org
>> Subject: [R] regression with proportion data
>> I understand that the binomial function concerns successes
>> vs. failures and can use those raw data, but the R Book and
>> other sources seem to suggest that proportion data are usable
>> as well.  Not so?
> You _can_ use a two-column matrix with counts of successes and failures in the two columns
> And if you know what the number n of observations was (which you would need to anyway for using proportions in a logistic regression) youcan calculate that matrix from the proportions and n, as long as you're reasonably careful about rounf=ding.

Yes, and you can also use the proportions directly; just specify
the corresponding vector of number of trials as the 'weights'
argument in the glm() call. See the Details section of ?glm.

Peter Ehlers

> S Ellison*******************************************************************
> This email and any attachments are confidential. Any use...{{dropped:8}}
> ______________________________________________
> 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.

More information about the R-help mailing list