Displaying 12 results from an estimated 12 matches for "sumry".
2004 Apr 24
4
Moving window regressions - how can I improve this code?
I wrote a function which does "moving window" regressions. E.g. if
there are 100 observations and the window width is 50, then I first
run the regression for observations 1..50, then for 2..51, and so on.
I am extremely pleased with R in my experience with writing this,
since I was able to pass the model as an argument into the function
:-) Forgive me if I sound naive, but that's
2012 Mar 20
1
overriding "summary.default" or "summary.data.frame". How?
...ght.
labelPos <- ifelse(datsummNT$mean - mean(datsummNT$mean, na.rm=T) > 0, 2, 4)
text(datsummNT$mean, datsummNT$var, labels=rownames(datsummNT),
cex=0.8, pos=labelPos)
x <- data.frame(x=rnorm(100), y = gl(50,2), z = rep(1:4, 25), ab = gl(2,50))
summarize(x)
summarize(x, numLevels=15)
sumry <- summarize(x)
sumry[[1]] ##another way to get the numerics output
sumry[[2]] ##another way to get the factors output
dat <- data.frame(x=rnorm(100), y = gl(50,2), z = factor(rep(1:4, 25),
labels=c("A","B","C","D")), animal=factor(ifelse(runif(100)<...
2000 Mar 07
1
update fails after specific sequence of steps (PR#474)
...45 high 15 medium 44
>
------------------ function test.terms and functions it calls ------------------------
> test.terms
function (object, ...)
{
UseMethod("test.terms")
}
> test.terms.lm
function (mod, error, ...)
{
if (!missing(error)) {
sumry <- summary(error, corr = FALSE)
s2 <- sumry$sigma^2
error.df <- error$df.residual
error.SS <- s2 * error.df
}
intercept <- has.intercept(mod)
p <- length(coefficients(mod))
I.p <- diag(p)
Source <- term.names(mod)
n.terms <-...
1999 Jul 08
0
summary.default & is.recursive
...3.3> [1] T
My change to summary.default was to fix the following warning in Splus3.2 and
3.3:
> summary.default(list(z, a=list(1:3)))
Length Class Mode
3 a numeric
a 1 list
Warning messages:
Replacement length not a multiple of number of elements to replace in: sumry[
i, 2] <- class(ii)
and consisted simply of changing
sumry[i, 2] <- if (is.object(ii))
class(ii)
to
sumry[i, 2] <- if (is.object(ii))
paste(class(ii), collapse=" ")
This may not be necessary in the current R version, but because of the above
error...
2005 Apr 04
1
How to extrct F value
Hello sir:
Here's the result of repeated measures ANOVA.
$"Error: Within"
Df Sum Sq Mean Sq F value Pr(>F)
t 2 524177 262089 258.24 1.514e-06 ***
Residuals 6 6089 1015
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
My question is: How to extract the F value only?
If the result is a
2011 Dec 19
1
pls help to print out first row of terms(model) output in example program
...lm( formula(fmla), data=dat)
results[[ i ]] <- maux
print(maux$call[2])
###fix me fix me ##
}
results
}
mcDiagnose <- function(model){
auxRegs <- lmAuxiliary(model)
auxRsq <- numeric(length=length(auxRegs))
j <- 0
for ( i in auxRegs ){
j <- j + 1
sumry <- summary(i)
auxRsq[j] <- sumry$r.squared
}
print("Drum roll please!")
print("And your R_j Squareds are (auxiliary Rsq)")
print(names(auxRegs))
print(auxRsq)
}
x1 <- rnorm(100)
x2 <- rnorm(100)
y <- rnorm(100)
m1 <- lm(y~x1+x2)
mcDiagnose(m1)...
2011 Sep 03
2
mclust: modelNames("E") vs modelNames=("V")
...9;m trying to use the library mclust for gaussian mixture on a numeric
vector. The function Mclust(data,G=3) is working fine but the fitting is not
optimal and is using modelNames="E". When I'm trying
Mclust(data,G=3,modelName="V") I have the following message:
Error in if (Sumry$G > 1) ans[c(orderedNames, "z")] else ans[orderedNames] :
argument is of length zero
In addition: Warning message:
In pickBIC(object[as.character(G), modelNames, drop = FALSE], k = 3) :
none of the selected models could be fitted
Using variable variance would fit my data better,...
2011 Sep 04
2
mclust: modelName="E" vs modelName="V"
...9;m trying to use the library mclust for gaussian mixture on a numeric
vector. The function Mclust(data,G=3) is working fine but the fitting is not
optimal and is using modelNames="E". When I'm trying
Mclust(data,G=3,modelName="V") I have the following message:
Error in if (Sumry$G > 1) ans[c(orderedNames, "z")] else ans[orderedNames] :
argument is of length zero
In addition: Warning message:
In pickBIC(object[as.character(G), modelNames, drop = FALSE], k = 3) :
none of the selected models could be fitted
Using variable variance would fit my data better,...
2003 Jan 29
3
Analyzing an unbalanced AB/BA cross-over design
...3 13.9171 6.495e-05 ***
Residuals 11 8254 750
According to the unbalanced design, I requested the type III SS which
resulted in an error statement
library(car)
Anova(example.lm, type="III")
Error in linear.hypothesis.lm(mod, hyp.matrix, summary.model = sumry, :
One or more terms aliased in model.
by using glm I got results with 0 df for the sequence effect !!!!
example.glm<-glm(outcome~treatment+period+sequence+subject%in%sequence,
data=example, family=gaussian)
library(car)
Anova(example.glm,type="III",test.statistic="F...
2010 Jun 03
3
Nested ANOVA with covariate using Type III sums of squares
...31 74110911
2390675
I have tried using both the drop1() command and the Anova() command in the
car package.
When I use the Anova command I get the following error message:
>Anova(carbonmean,type="III")
“Error in linear.hypothesis.lm(mod, hyp.matrix, summary.model = sumry,: One
or more terms aliased in model.”
I am not sure why this is aliased. There are no missing cells, and the cells
are balanced (aside from for the covariate). Each Phyto by Zoop cross is
replicated 3 times, and there are four Phyto levels within each level of
Diversity. When I remove the neste...
2010 Jun 02
0
Nested ANOVA with covariate using Type III sums of squares in R
...ls 31 74110911 2390675
I have tried using both the drop1() command and the Anova() command in the
car package.
When I use the Anova command I get the following error message:
>Anova(carbonmean,type="III")
?Error in linear.hypothesis.lm(mod, hyp.matrix, summary.model = sumry,:
One or more terms aliased in model.?
I am not sure why this is aliased. There are no missing cells, and the
cells are balanced (aside from for the covariate). Each Phyto by Zoop
cross is replicated 3 times, and there are four Phyto levels within each
level of Diversity. When I remove the nested...
2006 Dec 26
1
Colored Dendrogram
...<- function(model, type=c("hc3", "hc0", "hc1", "hc2",
> "hc4"),
>
> ...){
> if (!require(car)) stop("Required car package is missing.")
> type <- match.arg(type)
> V <- hccm(model, type=type)
> sumry <- summary(model)
> table <- coef(sumry)
> table[,2] <- sqrt(diag(V))
> table[,3] <- table[,1]/table[,2]
> table[,4] <- 2*pt(abs(table[,3]), df.residual(model), lower.tail=FALSE)
> sumry$coefficients <- table
> p <- nrow(table)
> hyp &l...