Hi everyone, I'm fairly new to R, and I don't have a background in statistics, so please bear with me. ;-) I'm dealing with 2^k factorial designs, and I was just wondering if there's any way to analyze more than two factors of a gage R&R study in R. For example, Minitab has an "expanded gage R&R" function that lets you include up to eight additional factors besides the usual two that are present in gage studies (parts and operators). If I wanted to include n additional random factors, is there a package or built-in functionality that will allow me to do that? I've been experimenting with the SixSigma package, and that has a ss.rr method which works great---as long as your experiment only contains two factors. I've also been using lmer from lme4 to fit a linear model of my experiment, but the standard deviations generated by lmer don't match what I'm seeing in Minitab. Since all my factors are random, the formula I'm using looks like this: vals ~ 1 + (1|f1) + (1|f2) + (1|f3) + (1|f1:f2) + (1|f1:f3) + (1|f2:f3) What am I doing wrong, and how can I fix it? Thanks, Matt
Bert Gunter
2012-Nov-19 23:31 UTC
[R] Performing gage R&R study in R w/more than 2 factors
I believe that you need to consult a local statistician, as there are likely way too many statistical issues here that you do not fully understand. Alternatively, try posting to a statistical list like stats.stackexchange.com, as I think most of your issues are primarily statistical, not R related. Cheers, Bert On Mon, Nov 19, 2012 at 11:12 AM, Matt Jacob <matt at jacobmail.org> wrote:> Hi everyone, > > I'm fairly new to R, and I don't have a background in statistics, so > please bear with me. ;-) > > I'm dealing with 2^k factorial designs, and I was just wondering if > there's any way to analyze more than two factors of a gage R&R study in > R. For example, Minitab has an "expanded gage R&R" function that lets > you include up to eight additional factors besides the usual two that > are present in gage studies (parts and operators). If I wanted to > include n additional random factors, is there a package or built-in > functionality that will allow me to do that? > > I've been experimenting with the SixSigma package, and that has a ss.rr > method which works great---as long as your experiment only contains two > factors. I've also been using lmer from lme4 to fit a linear model of my > experiment, but the standard deviations generated by lmer don't match > what I'm seeing in Minitab. Since all my factors are random, the formula > I'm using looks like this: > > vals ~ 1 + (1|f1) + (1|f2) + (1|f3) + (1|f1:f2) + (1|f1:f3) + (1|f2:f3) > > What am I doing wrong, and how can I fix it? > > Thanks, > > Matt > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
On Mon, Nov 19, 2012, at 18:26, David Winsemius wrote:> My guess is that you do not understand the meaning of a "random > factor". I certainly did not when I first encountered it. All my > training had been with ordinary regression and analysis of variance. > These are methods for what in mixed models are fixed effects. My > opinion is that these terms are completely confusing to the new > student of this sort of analysis.You're absolutely right---the distinction of fixed vs. random factors is confusing. However, I was under the impression that all factors in a gage R&R study were random, since we're trying to determine the sources of variability on the system.> My guess is the you may just want the output of: > > lm( vals ~ f1 * f2 * f3, data = yourdat)I'm trying to get the variance component estimates, and from there, I can calculate the percent tolerance and other interesting statistics. It doesn't look like lm gives me that information, though. FWIW, your formula is the same as what I'm feeding into aov, and the ANOVA table output *does* match up with what Minitab is producing. Matt