Re: [R] Specifying Prior Weights in a GLM

2010-12-12 Thread Enrique Garcia

Hey Dennis,

Thank you.  This was helpful.  It looks like the structure of my code was
incorrect.  I was using a variable containing proportions as my D.V. instead
of using a two column vector.  I re-ran the code using the following: 

Y-(successes/trials)

-Enrique 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/Specifying-Prior-Weights-in-a-GLM-tp3083480p3084674.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] Specifying Prior Weights in a GLM

2010-12-11 Thread Enrique Garcia

Hello R folks,

I have three questions. I am trying to run a logistic regression (binomial
family) where the response variable is a proportion.  According to R
Documentation in a binomial GLM prior weights are used to give the number
of trials when the response is the proportion of successes.  However when I
run my code I get the following error message:

Error in model.frame.default(formula = PER_ELA ~ A_EX + COMM + ENG + S_R + 
: 
  variable lengths differ (found for '(weights)')

I'm not sure what I am doing wrong.  My response variable is Y/M, which is
the proportion of 1's (successes) among M binary responses.  My prior weight
is a variable indicating the number of trials for each observation.  


This is an abbreviated version of the code that I ran: 

glm1-glm(PER_ELA~A_EX  PER_LEA,
family=binomial(link=logit),data=data2,weights=REG)


Question 1 and 2:
Does the number of trials for each observation in my dataset have to be the
same? What am I doing wrong here?


Question 3:
Is it OK for me to use percentages as predictor variables in a logistic
regression? 

-- 
View this message in context: 
http://r.789695.n4.nabble.com/Specifying-Prior-Weights-in-a-GLM-tp3083480p3083480.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.