Displaying 3 results from an estimated 3 matches for "nonadd".
Did you mean:
io_add
2009 Aug 02
3
two-factor linear models with missing cells
...t of situation:
y = round(rnorm(n=24,mean=5,sd=2),2)
A = gl(3,2,24,labels=c("one","two","three"))
B = gl(4,6,24,labels=c("i","ii","iii","iv"))
# Make both observations for A=1, B=4 missing
y[19] = NA
y[20] = NA
data.frame(y,A,B)
nonadd = lm(y ~ A * B)
> summary(nonadd)
Call:
lm(formula = y ~ A * B)
Residuals:
Min 1Q Median 3Q Max
-3.555e+00 -7.675e-01 -6.939e-17 7.675e-01 3.555e+00
Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.755 1.667 2.252 0.0457 *
Atwo 1.6...
2006 Jan 02
2
update?
I'm having problems with environments and update() that
I expect have a simple explanation. To illustrate, suppose
I wanted to make a very primitive Tukey one-degree-of-
freedom for nonadditivity test and naively wrote:
nonadd <- function(formula){
f <- lm(formula)
v <- f$fitted.values^2
g <- update(f, . ~ . + v)
anova(f,g)
}
x <- rnorm(20)
y <- rnorm(20)
nonadd(y ~ x)
Evidently, update is looking in the environment pr...
2008 Mar 30
1
Second & subsequent calls to function fails. Please help debug.
...lm)
7 : echo term verbatim (label=diag)
8 : echo term verbatim (label=tukey)
Error: chunk 8 (label=tukey)
Error in parse(text = x) :
unexpected symbol in "yield ~ variety + block + preds(yield+variety
+block+preds.sq)sq"
It failed in:
<<tukey>>=
require(alr3)
tukey.nonadd.test(ov.lm)
@
At that point I ran debug() on the call:
debug(tukey.nonadd.test)
tukey.nonadd.test(ov.lm)
debugging in: tukey.nonadd.test(ov.lm1)
debug: {
envir <- environment(formula(m))
dd <- eval(m$call$data, envir)
subs <- eval(m$call$subset, envir)
wgts <- eval(...