search for: wool

Displaying 20 results from an estimated 108 matches for "wool".

Did you mean: bool
2018 Jan 07
2
SpreadLevelPlot for more than one factor
Dear Ashim, Try spreadLevelPlot(breaks ~ interaction(tension, wool), data=warpbreaks) . I hope this helps, John ----------------------------- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada Web: socialsciences.mcmaster.ca/jfox/ > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of A...
2018 Jan 09
0
SpreadLevelPlot for more than one factor
Dear Sir, Many thanks for your reply. I have a query. I have a whole set of distributions which should be made normal / homoscedastic. Take for instance the warpbreaks data set. We have the following boxplots for the warpbreaks dataset: a. boxplot(breaks ~ wool) b. boxplot(breaks ~ tension) c. boxplot(breaks ~ interaction(wool,tension)) d. boxplot(breaks ~ wool @ each level of tension) e. boxplot(breaks ~ tension @ each level of wool) Now should we not be making a-e normal and homoscedastic? Should we not make a giant collection of boxplots from a-e and...
2018 Jan 14
1
SpreadLevelPlot for more than one factor
Dear Ashim, I?ll address your questions briefly but they?re really not appropriate for this list, which is for questions about using R, not general statistical questions. (1) The relevant distribution is within cells of the wool x tension cross-classification because it?s the deviations from the cell means that are supposed to be normally distributed with equal variance. In the warpbreaks data there are only 9 cases per cell. If you examine all of these deviations simultaneously, that?s equivalent to examining the residual...
2018 Jan 07
2
SpreadLevelPlot for more than one factor
Dear All, I want a transformation which will make the spread of the response at all combinations of 2 factors the same. See for example : boxplot(breaks ~ tension * wool, warpbreaks) The closest I can do is : spreadLevelPlot(breaks ~tension , warpbreaks) spreadLevelPlot(breaks ~ wool , warpbreaks) I want to do : spreadLevelPlot(breaks ~tension * wool, warpbreaks) But I get : > spreadLevelPlot(breaks ~tension * wool , warpbreaks) Error in spreadLevelPlot.f...
2009 Jan 14
3
Casting lists to data.frames, analog to SAS
I have a specific question and a general question. Specific Question: I want to do an analysis on a data frame by 2 or more class variables (i.e., use 2 or more columns in a dataframe to do statistical classing). Coming from SAS, I'm used to being able to take a data set and have the output of the analysis in a dataset for further manipulation. I have a data set with vote totals, with one
2012 Jul 27
1
Understanding the intercept value in a multiple linear regression with categorical values
Hi! I'm failing to understand the value of the intercept value in a multiple linear regression with categorical values. Taking the "warpbreaks" data set as an example, when I do: > lm(breaks ~ wool, data=warpbreaks) Call: lm(formula = breaks ~ wool, data = warpbreaks) Coefficients: (Intercept) woolB 31.037 -5.778 I'm able to understand that the value of intercept is the mean value of breaks when wool equals "A", and that adding up the "woolB" coeff...
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
...between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp <- tapply( breaks, list( wool, tension, variant ), mean ) tp # and hardly: ftable( xtabs( breaks ~ wool + tension + variant ) ) # It would be nice to flatten the tabulations, so I tried: ftable( tb ) tp <- as.table( tp ) fta...
2001 Sep 05
3
Bug in ftable?? (Was: Two-way tables of data, etc)
...between Murray Jorgensen and Brian Ripley, it seems to me better to choose tabulations that will not come and bite you. Suppose your data are sligtly irregular, e.g. (for the sake of the argument): data( warpbreaks ) warpbreaks$variant <- rep( 1:5, len=54 ) attach( warpbreaks ) tb <- table( wool, tension, variant ) tb # in this case you would like to see: tp <- tapply( breaks, list( wool, tension, variant ), mean ) tp # and hardly: ftable( xtabs( breaks ~ wool + tension + variant ) ) # It would be nice to flatten the tabulations, so I tried: ftable( tb ) tp <- as.table( tp ) fta...
2020 May 02
1
issues with environment handling in model.frame()
Dear all, model.frame behaves in a way I don't expect when both its formula and subset argument are passed through a function call. This works as expected: model.frame(~wool, warpbreaks, breaks < 15) #> wool #> 14 A #> 23 A #> 29 B #> 50 B fun1 <- function(y) model.frame(~wool, warpbreaks, y) fun1(with(warpbreaks, breaks < 15)) #> wool #> 14 A #> 23 A #> 29 B #> 50 B but this doesn't: fun2 <-...
2013 Feb 25
1
quesion about SS of ANOVA
...1 equals to SS_g1_dat2: The formula for computing SS is:sum(sample size of level(i)*(mean of level(i)-TotalMean)^2),with i refers to each level in SS_g1_dat1 and SS_g1_dat2. Every element of the formula is constant,so SS is constant. Using the dataset "warpbreaks" from R: anova(lm(breaks~wool)) Analysis of Variance Table Response: breaks Df Sum Sq Mean Sq F value Pr(>F) wool 1 450.7 450.67 2.6684 0.1084 Residuals 52 8782.1 168.89 anova(lm(breaks~wool+tension)) Analysis of Variance Table Response: breaks Df Sum Sq Mean Sq F value Pr(>F) wool...
2007 Aug 14
4
Problem with "by": does not work with ttest (but with lme)
...nction works fine with the lme function. Did I just miss something or is it really not working? If not, is there any other possibility to avoid loops? Thanks Daniel Here is the R help example for "by" require(stats) attach(warpbreaks) by(warpbreaks, tension, function(x) lm(breaks ~ wool, data = x)) *->works great by(warpbreaks,tension,function(x)t.test(breaks ~ wool,data=warpbreaks,paired = TRUE)) *Same output for each level of tension: tension: L Paired t-test data: breaks by wool t = 1.9956, df = 26, p-value = 0.05656 alternative hypothesis: true difference in means is n...
2018 Jan 07
0
SpreadLevelPlot for more than one factor
...On Sun, Jan 7, 2018 at 10:37 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote: > Dear All, > > I want a transformation which will make the spread of the response at all > combinations > of 2 factors the same. > > See for example : > > boxplot(breaks ~ tension * wool, warpbreaks) > > The closest I can do is : > > spreadLevelPlot(breaks ~tension , warpbreaks) > spreadLevelPlot(breaks ~ wool , warpbreaks) > > I want to do : > > spreadLevelPlot(breaks ~tension * wool, warpbreaks) > > But I get : > > > spreadLevelPlot(brea...
2010 May 18
2
how to select rows per subset in a data frame that are max. w.r.t. a column
...he sense that I can easily select the maximal values per subset using "aggregate", but I can't really figure out how to select the rows in the original data frame that are associated with these maximal values. library(stats) # this returns the list with maximal values for breaks per wool/tension subset maxValues = aggregate(warpbreaks$breaks, list(wool = wool, tension = tension), max) # now i'd like the subset of the rows in warpbreaks that are associated with these maximal values Thank you in advance! Tim. [[alternative HTML version deleted]]
2007 Sep 06
3
Warning message with aggregate function
Dear all, When I use aggregate function as: attach(warpbreaks) aggregate(warpbreaks[, 1], list(wool = wool, tension = tension), sum) The results are right but I get a warning message: "number of items to replace is not a multiple of replacement length." BTW: I use R version 2.4.1 in Ubuntu 7.04. Your kind solutions will be great appreciated. Best wishes Yours, sincerely, Xingwang Y...
2013 Apr 10
2
Table with n(%) formatting: A better way to do this?
...ogrammer. Ultimately want to have code that I can turn into a function. Will then use the output produced to make tables using odfWeave and Sweave/knitr. Thanks, Paul breaks <- as.data.frame(lapply(warpbreaks, function(x) rep(x, warpbreaks$breaks))) Freq <- with(breaks, addmargins(table(wool, tension), 2)) Prop <- round( prop.table(Freq, 2) * 100, 2 ) Freq <- addmargins(Freq, 1) Prop <- addmargins(Prop, 1) require(odfWeave) class(Freq) <- "character" class(Prop) <- "character" FreqProp <- matrixPaste(Freq, "(", Prop, "%)", sep...
2005 May 15
3
adjusted p-values with TukeyHSD?
hi list, i have to ask you again, having tried and searched for several days... i want to do a TukeyHSD after an Anova, and want to get the adjusted p-values after the Tukey Correction. i found the p.adjust function, but it can only correct for "holm", "hochberg", bonferroni", but not "Tukey". Is it not possbile to get adjusted p-values after
2012 Nov 29
2
Deleting certain observations (and their imprint?)
...em to remain, even though they have 0 observations. This is causing me problems later on. I'll use the dataset warpbreaks to illustrate, I apologize if this isn't in the best format ##Summary of warpbreaks suggests three tension levels (H, M, L) > summary(warpbreaks) breaks wool tension Min. :10.00 A:27 L:18 1st Qu.:18.25 B:27 M:18 Median :26.00 H:18 Mean :28.15 3rd Qu.:34.00 Max. :70.00 ## Subset the dataset and keep only those observations with "L" > wb.subset <- warpbreaks[...
2008 Apr 28
0
restricting pairwise comparisons of interaction effects
...ing the pairwise comparisons of interaction effects in a multi-way factorial ANOVA, because I find comparisons of interactions between all different variables different to interpret. For example (supposing a p<0.10 cutoff just to be able to use this example): > summary(fm1 <- aov(breaks ~ wool*tension, data = warpbreaks)) Df Sum Sq Mean Sq F value Pr(>F) wool 1 450.7 450.7 3.7653 0.0582130 . tension 2 2034.3 1017.1 8.4980 0.0006926 *** wool:tension 2 1002.8 501.4 4.1891 0.0210442 * Residuals 48 5745.1 119.7 --- Signif. codes: 0 '***...
1998 Oct 22
1
crosstab means
I would like to obtain a crosstabulation of means(var, quantiles...) i.e. I have a data frame with Var-i, Var-j, Var-k, Var-X, var-Y I like to have the mean of Var-X for each combination of Var-i,Var-j. One solution would be: by(var-i,Var-j,mean(Var-x)) but I would like it better formatted and with mean,S.Dev,n for each cell? Does anybody have some function to do this or some ideas how to go
2007 Aug 08
1
Change in R**2 for block entry regression
Hi all, I'm demonstrating a block entry regression using R for my regression class. For each block, I get the R**2 and the associated F. I do this with separate regressions adding the next block in and then get the results by writing separate summary() statements for each regression. Is there a more convenient way to do this and also to get the change in R**2 and associated F test for