[Rd] Discourage the weights= option of lm with summarized data

2017-10-07 Thread Arie ten Cate
In the Details section of lm (linear models) in the Reference manual, it is suggested to use the weights= option for summarized data. This must be discouraged rather than encouraged. The motivation for this is as follows. With summarized data the standard errors get smaller with increasing numbers

[Rd] Discourage the weights= option of lm with summarized data

2017-10-08 Thread Arie ten Cate
rvation in 'x' is sigma^2 / n, while the first three observations have variance sigma^2). Best, Wolfgang -Original Message- From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Arie ten Cate Sent: Saturday, 07 October, 2017 9:36 To: r-devel@r-project.org Subje

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-10-08 Thread Arie ten Cate
t; > Best, > Wolfgang > > -Original Message- > From: R-devel [mailto:r-devel-boun...@r-project.org] On Behalf Of Arie ten > Cate > Sent: Sunday, 08 October, 2017 14:55 > To: r-devel@r-project.org > Subject: [Rd] Discourage the weights= option of lm with summarized

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-10-12 Thread Arie ten Cate
c(0,1) > w <- c(49,51) > glm(y~1, weights=w, family=binomial) > > -pd > >> On 9 Oct 2017, at 07:58 , Arie ten Cate wrote: >> >> Yes. Thank you; I should have quoted it. >> I suggest to remove this text or to add the word "not" at the beginning. >

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-10-14 Thread Arie ten Cate
I think it is not a bug. It is a general property of interactions. This property is best observed if all variables are factors (qualitative). For example, you have three variables (factors). You ask for as many interactions as possible, except an interaction term between two particular variables.

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-10-27 Thread Arie ten Cate
0 0 > 3 1 1 0 0 1 0 > 4 1 1 0 0 -1 0 > 5 1 0 1 0 0 1 > 6 1 0 1 0 0 -1 > >> solve(t(mm) %*% mm) > Error in solve.default(t(mm) %*% mm) : system is computat

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-11-01 Thread Arie ten Cate
formula]"). However, the example I gave demonstrated that this dummy > variable encoding only occurs for the model where the missing term is the > numeric-numeric interaction, "~(X1+X2+X3)^3-X1:X2". Otherwise, the > interaction term X1:X2:X3 is encoded by contrasts, not dummy v

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-11-04 Thread Arie ten Cate
heuristic that > it's citing. > > Best regards, > Tyler > > On Thu, Nov 2, 2017 at 2:51 AM, Arie ten Cate wrote: >> >> Hello Tyler, >> >> Thank you for searching for, and finding, the basic description of the >> behavior of R in this matter. >

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-11-06 Thread Arie ten Cate
ng special for them, and it remains valid, in a trivial > sense, whenever any of the F_j is numeric rather than categorical." Since > F_j refers to both categorical and numeric variables, the behavior of > model.matrix is not consistent with the heuristic. > > Best regards, &g

Re: [Rd] Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing

2017-11-06 Thread Arie ten Cate
on is only following the cited behavior 1/3rd > of the time. > > Best regards, > Tyler > > On Mon, Nov 6, 2017 at 6:45 AM, Arie ten Cate wrote: >> >> Hello Tyler, >> >> You write that you understand what I am saying. However, I am now at >> loss about what

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-11-28 Thread Arie ten Cate
sch." Let us repair the other bug also. Arie On Thu, Oct 12, 2017 at 1:48 PM, Arie ten Cate wrote: > OK. We have now three suggestions to repair the text: > - remove the text > - add "not" at the beginning of the text > - add at the end of the text a warning

Re: [Rd] Discourage the weights= option of lm with summarized data

2017-12-03 Thread Arie ten Cate
n the case of replication weights, even wrong. > Hence, standard errors and analysis of variance tables should be > treated with care. > > OK? > > > -pd > > >> On 12 Oct 2017, at 13:48 , Arie ten Cate wrote: >> >> OK. We have now three suggesti