Re: [R] Issue with subset in glm

2017-03-22 Thread Bert Gunter
The subset argument is evaluated in "data" first, then in the caller's environment, etc. So: 1) In your first example, stype is a *vector*, and the subset expression is identically TRUE, hence is equivalent to making the call without the subset argument. 2) The second call fits the subset with st

Re: [R] Issue with subset in glm

2017-03-21 Thread David L Carlson
age- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ganz, Carl Sent: Tuesday, March 21, 2017 10:50 AM To: r-help@r-project.org Subject: [R] Issue with subset in glm Hello, I am experiencing odd behavior with the subset parameter for glm. It appears that the parameter uses non-stan

[R] Issue with subset in glm

2017-03-21 Thread Ganz, Carl
Hello, I am experiencing odd behavior with the subset parameter for glm. It appears that the parameter uses non-standard evaluation, but only in some cases. Below is a reproducible example. library(survey) # for example dataset data(api) stype <- "E" (a <- glm(api00~ell+meals+mobility, data =