search for: npk

Displaying 20 results from an estimated 37 matches for "npk".

Did you mean: np
2013 Jan 17
3
Colors in interaction plots
Hi, I am trying to plot an interaction.plot with different color for each level of a factor. It has an erratic behavior. For example, it works for the first interaction.plot below, with the example from the ALDA book, but not with the other plots, from the NPK dataset: # from http://www.ats.ucla.edu/stat/r/examples/alda/ch2.htm tolerance <- read.csv("http://www.ats.ucla.edu/stat/r/examples/alda/data/tolerance1.txt") tolerance.pp <- read.csv("http://www.ats.ucla.edu/stat/r/examples/alda/data/tolerance1_pp.txt") attach(tolerance....
2007 Jan 15
2
model simplification in repeated anova
Hi, I've done a repeated ANOVA looking as follows: model<-aov(y~a*b*c+Error(d)) Now I want to get rid of some or all of the interactions. But neither AIC nor anova work. What is the appropriate function to test my model?
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 <- lm(model, npk) ( s.npk.lm <- summary(npk.lm) ) ... Estimate Std. Error t value Pr(>|t|) (Intercept) 54.8750 0.8021 68.415 < 2e-16 *** block1 1.7125 1.3893...
2005 May 20
1
Problem with proj
...,1,1,0,1,1,0,0,1,0,1,0,1,1,0,0) P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5, 55.0, 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0) npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P), K=factor(K), yield=yield) npk.aov <- aov(yield ~ block + N*P*K, npk) proj(npk.aov) ## as a test, not particularly sensible options(contrasts=c("contr.helmert", "contr.treatment")) npk.aovE <- aov(...
1999 Nov 30
3
model.tables
A non-text attachment was scrubbed... Name: not available Type: text Size: 3126 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-help/attachments/19991130/5cb00c0f/attachment.pl
2003 Jan 24
1
model.tables and NA?
...,0,0) P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5, 55.0, 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,NA) # My change npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P), K=factor(K), yield=yield) npk.aov <- aov(yield ~ block + N*P*K, npk) model.tables(npk.aov, "means", se=TRUE) you get the error > model.tables(npk.aov, "means", se=TRUE) Error...
2008 Nov 26
1
S4 slot containing either aov or NULL
...#but it won't work with aov or null setClassUnion("aovOrNULL", c("aov", "NULL")) setClass("c1", representation(value = "aovOrNULL")) y1 = new("c1", value = NULL) #trying to assign an aov object to the slot doesn't work utils::data(npk, package="MASS") npk.aov <- aov(yield ~ block + N*P*K, npk) y2 = new("c1", value = npk.aov ) Any ideas? Thank you Thomas Kaliwe
2009 Feb 18
2
[package-car:Anova] extracting residuals from Anova for Type II/III Repeated Measures ?
Hello dear R members. I have been learning the Anova syntax in order to perform an SS type III Anova with repeated measures designs (thank you Prof. John Fox!) And another question came up: where/what are the (between/within) residuals for my model? ############ Play code: phase <- factor(rep(c("pretest", "posttest", "followup"), c(5, 5, 5)),
2003 Apr 17
2
make check failure with R-1.7.0
...1,1,0,0,1,0,1,0,1,1,0,0) + P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) + K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) + yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0, + 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0) + npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P), + K=factor(K), yield=yield) + } > > op <- options(contrasts=c("contr.helmert", "contr.poly")) > npk.aov <- aov(yield ~ block + N*P*K, npk) Error in terms.formula(formula, "Error&quot...
2002 Jan 25
1
interpretation of lm
...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...
2017 Nov 29
1
2^3 confounded factorial experiment
The following R commands were written: >help.search("factorial") >data(npk) >npk >coef(npk.aov) In the output of coef command, please explain me the interpretation of coefficients of block1 to block 6 in this 2^3 confounded factorial experiment. Thanks. [[alternative HTML version deleted]]
2009 May 13
2
Multiple ANOVA tests
Hello!!! I'm trying to do multiple ANOVA tests with R (testing the affect off different factors on the same response). As a result I get many ANOVA tables, and I want to extract a list of the "Pr(>F)" from all the tables. Maybe someone have an idea how to do this? Thanks Imri -- View this message in context:
2010 Jul 23
1
model.tables call fails with "Error in inherits(object, "formula")"
...ORKS aovfit <- aov(as.formula(frmlb), dat); print(model.tables(aovfit, "means")); frmlc <- "yield ~ block + Error(N/block)"; # DOES NOT WORK aovfit <- aov(as.formula(frmlc), dat); print(model.tables(aovfit, "means")); } utils::data(npk, package="MASS"); frmla <- "yield ~ block + Error(N/block)"; # WORKS aovfit <- aov(as.formula(frmla), npk); print(model.tables(aovfit, "means")); test(npk); ## End of example Output of sessionInfo(): R version 2.11.1 (2010-05-31) i386-pc-mingw32 locale:...
2007 May 11
1
Anova
Doea anyone know how to compute components of variance analysis? For example, I have the score of pupils on a test. Each pupil belongs to a school and within each school I may have several classes? How can I estimate the variance of the pupils, schools, classes and the errror variance? Any examples? Any help will be appreciated. Jason Dr. Iasonas Lamprianou Department of Education The
2002 Aug 06
2
AOV in MASS not the same??
...1,1,0,0) > P <- c(1,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,1,0,0,1,0,1,1,0) > K <- c(1,0,0,1,0,1,1,0,0,1,0,1,0,1,1,0,0,0,1,1,1,0,1,0) > yield <- c(49.5,62.8,46.8,57.0,59.8,58.5,55.5,56.0,62.8,55.8,69.5,55.0, + 62.0,48.8,45.5,44.2,52.0,51.5,49.8,48.8,57.2,59.0,53.2,56.0) > npk <- data.frame(block=gl(6,4), N=factor(N), P=factor(P), + K=factor(K), yield=yield) > > ( npk.aov <- aov(yield ~ block + N*P*K, npk) ) Call: aov(formula = yield ~ block + N * P * K, data = npk) Terms: block N P...
2003 Dec 18
1
prevent aov re-ordering of model terms
Is there a way to prevent the re-ordering of factors by aov? I do have a three-way interaction that I do want to fit before a two-way interaction (different factors, so they are not nested), but R moves the two-way interaction to the front. I know it generally makes sense to fit the two-way interactions first, but in this case I think I know what I'm doing. + hv
2003 Jun 26
1
Correct contrast for unreplicated 2K factorial design
Hi all, I have been trying to reproduce an analysis from Douglas Montgomery?s book on design and analysis of experiments. Table 6.10 of example 6.2 on page 246, gives a table as follows: > NPK <- expand.grid(A=mp,B=mp,C=mp,D=mp) > Rate <- c(45,71,48,65,68,60,80,65,43,100,45,104,75,86,70,96) > filtration <- cbind(NPK,Rate) > filtration A B C D Rate 1 - - - - 45 2 + - - - 71 3 - + - - 48 4 + + - - 65 5 - - + - 68 6 + - + - 60 7 - + + - 80 8 + +...
2008 Feb 17
0
difference between lme and lmer in df calculation
...model selection with mixed models is a tricky issue, the two packages currently produce different AIC scores for the same model, but they systematically differ by 2. In looking at the logLik values for each method, I find that they indeed differ by 1. So, the following code: utils::data(npk, package="MASS") library(lme4) a<-lmer(yield ~ 1+(1|block), data=npk) logLik(a) library(nlme) b<-lme(yield ~ 1, random=~1|block, data=npk) logLik(b) produces a df of 2 for a, and a df of 3 for b. I'm guessing that lmer is not accounting for the level-1 variance. Is this t...
2005 Jan 31
2
Automatically Extracting F- and P- vals from ANOVA
Dear R community, I'm currently using R to analyze functional Magnetic Resonance Imaging data. Each analysis involves running ~120,000 repeated-measures ANOVAs. I would like to know if there is any automatic way to access the F- and P-value data that are associated with each of these 120,000 ANOVAs. For example, if the summary output (for the 1st ANOVA of 120,000) shows the following value
2004 Aug 17
2
aov summary to matrix
Is there an easy way of converting an aov.summary into a matrix in which the rows are the factor names and the columns are Df, Sum Sq, Mean Sq, F value and Pr. For example, convert Df Sum Sq Mean Sq F value Pr(>F) block 5 343.29 68.66 4.4467 0.015939 * N 1 189.28 189.28 12.2587 0.004372 ** P 1 8.40 8.40 0.5441 0.474904 K