search for: afit

Displaying 13 results from an estimated 13 matches for "afit".

Did you mean: abit
2013 Jul 01
2
Problem with anova and the new abbreviation restrictions
...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] 2.905607e-06 NA Warning message: In `$.data.frame`(afit, P) : Name partially matched in data frame > afit$Pr(>F) Error: unexpected '>' in "afit$Pr(>" The second is a result of allowing TAB completion of t...
2009 Nov 05
4
The equivalence of t.test and the hypothesis testing of one way ANOVA
...rnative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -0.2156863 1.6584968 sample estimates: mean of x mean of y 0.3589240 -0.3624813 > > A = c(rep('x',N1),rep('y',N2)) > Y = c(x,y) > fr = data.frame(Y=Y,A=as.factor(A)) > afit=aov(Y ~ A,fr) > > X=model.matrix(afit) > B=afit$coefficients > V=solve(t(X) %*% X) > > mse=tail(summary(afit)[[1]]$'Mean Sq',1) > df=tail(summary(afit)[[1]]$'Df',1) > t_statisitic=(B/(mse * sqrt(diag(V))))[[2]] > 2*(1-pt(abs(t_statisitic),df))#the p-value...
2013 Feb 12
0
error message from predict.coxph
...ar2) in defining dt (and dt2) in one part of predict.coxph: # #if (ncol(y) == 2) { # if (se.fit) { # dt <- (chaz * newx[indx2, ]) - xbar[indx2, ] # *** SHOULD BE JUST xbar # se[indx2] <- sqrt(varh + rowSums((dt %*% object$var) * dt)) * newrisk[indx2] # } #} #else { # j2 <- approx(afit$time, 1:afit.n, newy[indx2, 2], method = "constant", f = 0, yleft = 0, yright = afit.n)$y # chaz2 <- approx(-afit$time, afit$cumhaz, -newy[indx2, 2], method = "constant", rule = 2, f = 0)$y # chaz2 <- c(0, afit$cumhaz)[j2 + 1] # pred[indx2] <- (chaz2 - chaz) * newris...
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 4 1.676 0.41897 0.4857 0.74617 A:B 6 5.133 0.85554 0.9919 0.43404 A:C 8 14.193 1.77406 2.0568 0.04543 * B:C...
2009 Sep 17
2
What does model.matrix() return?
...] "contr.treatment" Regards, Peng > a=2 > b=3 > n=4 > A = rep(sapply(1:a,function(x){rep(x,n)}),b) > B = as.vector(sapply(sapply(1:b, function(x){rep(x,n)}), function(x){rep(x,a)})) > Y = A + B + rnorm(a*b*n) > fr = data.frame(Y=Y,A=as.factor(A),B=as.factor(B)) > afit=aov(Y ~ A + B,fr) > model.matrix(afit) (Intercept) A2 B2 B3 1 1 0 0 0 2 1 0 0 0 3 1 0 0 0 4 1 0 0 0 5 1 1 0 0 6 1 1 0 0 7 1 1 0 0 8 1 1 0 0 9 1 0 1 0 10 1 0...
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]]
2009 Sep 15
1
coefficients of aov results has less number of elements?
...cients (A1, A2, A3, B1, B2, B3, B4)? > a=3 > b=4 > n=1000 > A = rep(sapply(1:a,function(x){rep(x,n)}),b) > B = as.vector(sapply(sapply(1:b, function(x){rep(x,n)}), function(x){rep(x,a)})) > Y = A + B + rnorm(a*b*n) > > fr = data.frame(Y=Y,A=as.factor(A),B=as.factor(B)) > afit=aov(Y ~ A + B - 1,fr) > afit$coefficients A1 A2 A3 B2 B3 B4 1.993067 2.969252 3.965888 1.005445 2.020717 3.023940 Regards, Peng
2009 Sep 22
1
Singular model.matrix of nested designs
...1 1 [4,] 1 1 [5,] 1 2 [6,] 1 2 [7,] 1 2 [8,] 1 2 [9,] 1 3 [10,] 1 3 [11,] 1 3 [12,] 1 3 [13,] 2 4 [14,] 2 4 [15,] 2 4 [16,] 2 4 [17,] 2 5 [18,] 2 5 [19,] 2 5 [20,] 2 5 [21,] 2 6 [22,] 2 6 [23,] 2 6 [24,] 2 6 > Y = A + B + rnorm(a*b*n) > fr = data.frame(Y=Y,A=as.factor(A),B=as.factor(B)) > afit=aov(Y ~ A / B - 1,fr) > X=model.matrix(afit) > solve(t(X) %*% X) Error in solve.default(t(X) %*% X) : Lapack routine dgesv: system is exactly singular
2009 Nov 22
1
Why F value and Pr are not show in summary() of an aov() result?
...fb +fa*fc +fb*fc +fa*fe +fc*fe +fa*fb*fc +fa*fc*fe + rnorm(1) + } > > aframe = data.frame( + A=as.factor(X[,'A']) + , B=as.factor(X[,'B']) + , C=as.factor(X[,'C']) + , D=as.factor(X[,'D']) + , E=as.factor(X[,'E']) + ,Y) > > afit=aov(Y ~ A * B * C * D * E, aframe) > > summary(afit) Df Sum Sq Mean Sq A 2 1512240 756120 B 3 453324 151108 C 4 2549895 637474 D 5 2 0.3693 E 6 1451057 241843 A:B 6 33875 5646 A:C 8...
2010 Feb 03
0
contrast package tutorial
...ontrast 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 = data.frame(Y=Y, A=as.factor(A)) aframe afit=aov(Y ~ A - 1, aframe) contrast(afit, list=(A='3'), list=(A='4'))
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
2010 Jun 18
1
ow to apply a panel function to each of several data series plotted on the same graph in lattice
...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 then plot them, but wondered if there was an easier way. Thank you for any advice. Here is an example: # use an example panel function using smooth.spline; however, the issue relates to all panel functions # a panel function to fit smoothed lines t...
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",