Displaying 20 results from an estimated 6000 matches similar to: "coefficients of aov results has less number of elements?"
2009 Nov 22
1
Why F value and Pr are not show in summary() of an aov() result?
I have the following code. I'm wondering why summary() doesn't show F
value and Pr?
Rscript multi_factor.R
> a=3
> b=4
> c=5
> d=6
> e=7
>
> A=1:a
> B=1:b
> C=1:c
> D=1:d
> E=1:e
>
> X=matrix(nr=a*b*c*d*e,nc=5)
> colnames(X)=LETTERS[1:5]
>
> for(i_a in 1:a-1) {
+ for(i_b in 1:b-1) {
+ for(i_c in 1:c-1) {
+ for(i_d in 1:d-1) {
+
2009 Nov 05
4
The equivalence of t.test and the hypothesis testing of one way ANOVA
I read somewhere that t.test is equivalent to a hypothesis testing for
one way ANOVA. But I'm wondering how they are equivalent. In the
following code, the p-value by t.test() is not the same from the value
in the last command. Could somebody let me know where I am wrong?
> set.seed(0)
> N1=10
> N2=10
> x=rnorm(N1)
> y=rnorm(N2)
> t.test(x,y)
Welch Two Sample t-test
data:
2010 Feb 09
1
"1 observation deleted due to missingness" from summary() on the result of aov()
I have the R code at the end. The last command gives me "1 observation
deleted due to missingness". I don't understand what this error
message. Could somebody help me understand it and how to fix the
problem?
> summary(afit)
Df Sum Sq Mean Sq F value Pr(>F)
A 2 0.328 0.16382 0.1899 0.82727
B 3 2.882 0.96057 1.1136 0.34644
C
2009 Sep 17
2
What does model.matrix() return?
Hi,
I don't understand what the meaning of the following lines returned by
model.matrix(). Can somebody help me understand it? What can they be
used for?
attr(,"assign")
[1] 0 1 2 2
attr(,"contrasts")
attr(,"contrasts")$A
[1] "contr.treatment"
attr(,"contrasts")$B
[1] "contr.treatment"
Regards,
Peng
> a=2
> b=3
> n=4
2009 Sep 14
2
What are the return values of aov?
Hi,
I don't quite understand what are the return values of aov. I know
that it has 'coefficients'. But I need to know what all the other
return values are. Can somebody let me know how to figure them?
Value:
An object of class 'c("aov", "lm")' or for multiple responses of
class 'c("maov", "aov", "mlm",
2013 Jul 01
2
Problem with anova and the new abbreviation restrictions
An unwanted side effect of the new restrictions on abrreviated names.
The anova.coxph command, in a slavish copy of anova.lm etc, returns a data frame with
column labels of
loglik Chisq Df Pr(>|Chi|)
If one tries to extract the final column of the table errors result since it is not a
standard R variable name.
> afit <- anova(lm(conc ~ uptake, CO2))
> afit$P
[1]
2009 Sep 22
1
Singular model.matrix of nested designs
Hi,
I want to do ANOVA for nested designs like following. I don't
understand why the matrix (t(X) %*% X) is singular. Can somebody help
me understand it?
Regards,
Peng
> a=2
> b=3
> n=4
> A = as.vector(sapply(1:a,function(x){rep(x,b*n)}))
> B = as.vector(sapply(1:(a*b), function(x){rep(x,n)}))
> cbind(A,B)
A B
[1,] 1 1
[2,] 1 1
[3,] 1 1
[4,] 1 1
[5,] 1 2
[6,] 1 2
[7,]
2010 Feb 03
0
contrast package tutorial
I read the vignette of contrast package. I don't think that I
understand how to use it.
I made the following simpler example (contrast between '3' and '4').
Could somebody let me know what is the correct way to compute the
contrast in the following example?
library(contrast)
a=3
n=4
A = as.vector(sapply(1:a,function(x){rep(x,n)}))
Y = A + rnorm(a*n)
aframe =
2010 Apr 21
1
How to obtain the coefficients from a summary of aov ?
Dear Madame, Dear Sir,
I am able to obtain the coefficients from a 'summary' of 'lm', but NOT from a 'summary' of 'aov'.
The following example shows my steps.
## Initialize
rm(list = ls()) # remove (almost) everything in the working environment
utils::data(npk, package="MASS") # get data
model <- yield ~ block + N*P*K
## Using lm
npk.lm <-
2013 Feb 12
0
error message from predict.coxph
In one particular situation predict.coxph gives an error message. Namely: stratified data, predict='expected', new data, se=TRUE. I think I found the error but I'll leave that to you to decide.
Thanks,
Chris
######## CODE
library(survival)
set.seed(20121221)
nn <- 10 # sample size in each group
lambda0 <- 0.1 # event rate in group 0
lambda1 <- 0.2 # event rate in group 1
2004 Jul 29
3
Editing Strings in R
I was wondering if there is a way of editting strings in R. I
have a set of strings and each set is a row of numbers and paranthesis.
For example the first row is:
(0 2)(3 4)(7 9)(5 9)(1 5)
and I have a thousand or so such rows. I was wondering how I
could get the corresponding string obtained by adding 1 to all the
numbers in the string above.
Dursun
[[alternative HTML version deleted]]
2010 Jun 18
1
ow to apply a panel function to each of several data series plotted on the same graph in lattice
Hi
is it possible to fit a trend line (or some other panel function) through each of multiple data series plotted on the same graph? Specifically, while one can do something like
xyplot(a+b+c~x)
which plots three series, a,b & c, but can one automatically fit lines through each of them?
I suppose one could generate three more variables afit, bfit, and cfit with a model & predict and
2009 Oct 19
1
access elements of summary.aov?
Dear all
How do I access individual elements of a "summary.aov" object?
> data(iris)
> AnovaModel.1 <- aov(Sepal.Length ~ Species, data=iris)
> tmp <- summary(AnovaModel.1)
> tmp
Df Sum Sq Mean Sq F value Pr(>F)
Species 2 63.2 31.6 119 <2e-16 ***
Residuals 147 39.0 0.3
---
Signif. codes: 0 '***' 0.001 '**' 0.01
2003 Jul 07
2
(PR#3427)
Hi;
I am having problems inverting matrices using the function
solve()
For example R can not invert the following matrix
[,1] [,2] [,3] [,4]
[,5]
[1,] 25 500 11250 275000
7.106250e+06
[2,] 500 11250 275000 7106250
1.906250e+08
2002 Sep 24
4
extracting elements from summary(aov object)
Hello. When one types "summary(fit)", where fit is an object from a call
to aov(), one gets an ANOVA table. I want to save just one element of this
summary. How does one extract this?
As an example, here is my output from a split plot ANOVA:
> summary(out)$"Error: soil.cores$block:soil.cores$treatment"
Df Sum Sq Mean Sq F value Pr(>F)
2002 Jul 05
1
balance in AoV (was aov() and NaN)
<ripley at stats.ox.ac.uk> wrote:
> Hint 2: in the absence of balance, ...., and lme can do that
Would it be possible to make aov like wrappers to the various special lm variants
allowing for a uniform syntax for anova?
aov(resp~f1*f2+Error(S/(f1*f2))) ## uses lm
aov.lme(resp~f1*f2+Error(S/(f1*f2))) ## uses lme
aov.rlm(resp~f1*f2+Error(S/(f1*f2))) ## uses rlm
...
I'd do it, but I
2012 Oct 04
1
can stepAIC be customized to exclude coefficients with p-value less than certain values?
For example, if coefficient's p-value is less than 0.1 I want the stepwise
to automatically drop that variable. Can the stepAIC be customized to do
that? SAS seems to be able to customized stepwise function with p-value
or cooks'd.
thanks!
______________________________________________________________________
The information transmitted, including any attachments, is intended only
2008 Nov 26
1
S4 slot containing either aov or NULL
Dear listmembers,
I would like to define a class with a slot that takes either an object
of class aov or NULL. I have been reading "S4 Classes in 15 pages more
or less" and "Lecture: S4 classes and methods"
#First I tried with list and NULL
setClass(listOrNULL")
setIs("list", "listOrNULL")
setIs("NULL", "listOrNULL")
#doesn't
2008 Oct 29
2
how to get the value of aov summary into another variable
Hi,
I have a question of aov. e.g.
aov.ex = aov(x~y)
summary(aov.ex)
The aov summary will print to the screen. How can I extract the aov
result, in particular the values of Pr(>F) and F value into a vector
so that I can use them for other use?
Thanks.
--
Waverley @ Palo Alto
2005 Nov 08
1
Type II and III sums of squares with Error in AOV
I've recently run into the problem of using aov with nested factors,
and wanting to get the type II and III sums of squares. Normally Anova
from the car package would do fine, but it doesn't like having an Error
included, so
my.aov <-aov(Response ~ Treatment + Error(Treatment:Replicate))
Anova(my.aov, type="II")
yields
Error in Anova(nested.anova) : no applicable method