[R] glm.fit when family argument is not a "family" object

Bert Gunter gunter.berton at gene.com
Sun Feb 22 23:46:24 CET 2015


...
But

glm(1~1, family = gaussian)  ## works. As does family = "gaussian"

(R 3.1.2 )

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll




On Sun, Feb 22, 2015 at 1:55 PM, Mathew McLean <mmclean at stat.tamu.edu> wrote:
> The documentation for glm/glm.fit indicates that the family argument "can
> be a character string naming a family function, a family function or the
> result of a call to a family function".
>
> glm.fit(1, 1, family = "gaussian")
>
> ## Error: $ operator is invalid for atomic vectors
>
> glm.fit(1, 1, family = gaussian)
>
> ## Error: object of type 'closure' is not subsettable
>
> glm.fit(1, 1, family = gaussian())  # works, results omitted
>
> sessionInfo()
>
> ## R version 3.1.2 Patched (2015-02-20 r67856)
> ## Platform: x86_64-w64-mingw32/x64 (64-bit)
> ## Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> ## locale:
> ## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> States.1252
> ## [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
>
> ## [5] LC_TIME=English_United States.1252
>
> ## attached base packages:
> ## [1] stats     graphics  grDevices utils     datasets  methods   base
>
> ## loaded via a namespace (and not attached):
> ## [1] tools_3.1.2
>
>
> --
> Mathew W. McLean
> Research Assistant Professor
> 462 Blocker Building
> Texas A&M University
> www.stat.tamu.edu/~mmclean
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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