[R] interpretation of lm
dechao wang
dechwang at yahoo.co.uk
Fri Jan 25 11:43:51 CET 2002
Dear statistitians / R users,
I was told to analyse the effects of the four factors
using lm or update for aov. The following is the
result from lm. As you can see that in the last few
lines enclosed coefficients.
1)Does this mean I can write a formula, like
yield =0.26 + 0.03*H + 1.48*T + 0.04*L + 0.004*C
2) in the two levels design, is there any difference
between I use (-1, 1) to represent the lower and
higher levels and I use (5000, 10000) as the real
levels?
3) how can I extract the coefficients after analysis,
I mean can I write the coefficients as a vector?
4) how can I call R function from C code, for example,
can I call lm(...) from C functiomns?
5) after experiment designs, we can analyse which
factors have big effects, can we construct in R a
response surface so that we can optimise the levels of
the factors by maxmising the response surface, can you
advise me how to do that in R?
6) if the number of factors is over 1000, is it
possible to analyse the effect of each factor using
the same way as above?
Many thanks
Dechao
> >
> > Dear R users,
> >
> > I did 16 experiments, with 16 responses (yield),
> and 4
> > factors(hidden, theres, lrate, cycl) with each
> having
> > 2 levels as shown below. I want to do analysis of
> > variance to see which factor affect the response.
> The
> > coses are as follows:
> >
> > hidden<-c(2,2,10,10,2,2,10,10,2,2,10,10,2,2,10,10)
> > theres<-c(0.0001, 0.1, 0.0001, 0.1, 0.0001, 0.1,
> > 0.0001, 0.1, 0.0001, 0.1, 0.0001, 0.1, 0.0001,
> 0.1,
> > 0.0001, 0.1)
> >
>
lrate<-c(0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.9,0.9,0.9,0.9,0.9,0.9,0.9,0.9)
> >
>
cycl<-c(5000,5000,5000,5000,10000,10000,10000,10000,5000,5000,5000,5000,10000,10000,10000,10000)
> > yield<-c(0.26, 1.77, 0.29, 1.75, 0.26, 1.77, 0.31,
> > 1.75, 0.29, 1.78, 0.35, 1.83, 0.29, 1.79, 0.35,
> 1.83)
> >
> > npk <- data.frame(H=factor(hidden),
> > T=factor(theres),
> > L=factor(lrate),
> > C=factor(cycl), yield=yield)
> >
> > ( npk.aov <- aov(yield ~ H*T*L*C, npk) )
> > summary(npk.aov)
> >
> > when I run it, I got the following results: but
> there
> > is no any F values and p-values. Can you please
> advise
> > me what I missed? Many thanks in advance, dechao
>
>
> Your model is much to complex for only 16
> observations.
>
> The following e.g. works:
>
> tmp <- lm(yield ~ H+T+L+C, npk)
> > summary(tmp)
>
> Call:
> lm(formula = yield ~ H + T + L + C, data = npk)
>
> Residuals:
> Min 1Q Median 3Q Max
> -0.029375 -0.009687 -0.001250 0.011563 0.025625
>
> Coefficients:
> Estimate Std. Error t value Pr(>|t|)
> (Intercept) 0.260625 0.010618 24.545 5.88e-11 ***
> H10 0.031250 0.009497 3.290 0.007200 **
> T0.1 1.483750 0.009497 156.228 < 2e-16 ***
> L0.9 0.043750 0.009497 4.607 0.000757 ***
> C10000 0.003750 0.009497 0.395 0.700503
> ---
> Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.'
> 0.1 ` ' 1
>
__________________________________________________
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list