Is there a way to obtain the observed power of an aov()? I perform an aov with one between and one within factor, and would like to know the observed power of the tests, both for the main effect and the interaction. I found the package ''hpower'', but sense there is a more convenient possibility. Is there? thanks Mark M. Span -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Mark M. Span" <span at psy.uva.nl> writes:> Is there a way to obtain the observed power of an aov()? > > I perform an aov with one between and one within factor, and would like to > know the observed power of the tests, both for the main effect and the > interaction. I found the package ''hpower'', but sense there is a more > convenient possibility. Is there? > > thanks > > Mark M. SpanWhat''s "observed power"? If you mean the item that SPSS has by that name, I think you first have to convince us that that is a sensible thing to calculate... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /''_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA [mailto:p.dalgaard at biostat.ku.dk] wonders: | Sent: Saturday, 27 January 2001 1:29 | To: Mark M. Span | Cc: r-help at stat.math.ethz.ch | Subject: Re: [R] observed power | | | "Mark M. Span" <span at psy.uva.nl> writes: | | > Is there a way to obtain the observed power of an aov()? | > | > I perform an aov with one between and one within factor, | > and would like to know the observed power of the tests, | > both for the main effect and the interaction. I found the | > package ''hpower'', but sense there is a more convenient | > possibility. Is there? | > | > thanks | > | > Mark M. Span | | What''s "observed power"? If you mean the item that SPSS has by that | name, I think you first have to convince us that that is a sensible | thing to calculate... If you ever do find out, Peter, let me know too, please. I was puzzled, but a bit worried about showing my ignorance... I can only imagine it means an estimate of the non-centrality parameter in which case it is a sensible thing to have available since it is essentially the signal-to-noise ratio. Actually the MLE is the F-statistic but the maximum *marginal* likelihood estimate (based on the marginal distribution of the F-statistic itself) is of more interest as it is closer to unbiased. In the case of the multiple correlation coefficient, for example, this is (practically) what people call the "adjusted R^2" statistic, where the adjustment is essentially a bias correction. You can come up with simple analogues for non-central chi-squared and non-central F of course, but they are again just simple linear adjustments, unless you really want to get flash. (I wrote a couple of papers on this stuff in the 70s so I have a kind of nostalgic affinity for it...) I would be more interested in these quantities optionally appearing routinely on summary tables than, for example, the cute ''significance stars''. But as for calling them the "observed power", I would definitely caution against that. It encourages entirely the wrong idea of what power really is. (For example, it is a function, not a quantity, and you don''t ever "observe" it in practice.) Bill Venables. -- Bill Venables, CSIRO/CMIS Environmetrics Project Email: Bill.Venables at cmis.csiro.au Phone: +61 7 3826 7251 Fax: +61 7 3826 7304 Postal: PO Box 120, Cleveland, Qld 4163, AUSTRALIA -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Two or three years ago there was an extended discussion on sci.stat.consult concerning "post-hoc power analysis". If memory serves (since DejaNews is not currently allowing searches back that far), it was power estimation using the sample estimate of the variance done after conducting a "failed" experiment . Some of the contributors did not seem to understand that the variance was subject to sampling error. Using the observed interim sample variance to determine a plausible number of additional subjects would seem of some use after an experiment of insufficient size had testing consistent with the null. (With appropriate regard for adjusting alpha after multiple tests.) It doesn''t need to be distinguished by a separate term, and any reasonable interpretation would already be subsumed under existing interim analysis strategies. Regards; David Winsemius Bill.Venables at CMIS.CSIRO.AU wrote:> > Peter Dalgaard BSA [mailto:p.dalgaard at biostat.ku.dk] wonders: > > | Sent: Saturday, 27 January 2001 1:29 > | To: Mark M. Span > | Cc: r-help at stat.math.ethz.ch > | Subject: Re: [R] observed power > | > | > | "Mark M. Span" <span at psy.uva.nl> writes: > | > | > Is there a way to obtain the observed power of an aov()? > | > > | > I perform an aov with one between and one within factor, > | > and would like to know the observed power of the tests, > | > both for the main effect and the interaction. I found the > | > package ''hpower'', but sense there is a more convenient > | > possibility. Is there? > | > > | > thanks > | > > | > Mark M. Span > | > | What''s "observed power"? If you mean the item that SPSS has by that > | name, I think you first have to convince us that that is a sensible > | thing to calculate... > > If you ever do find out, Peter, let me know too, please. I was puzzled, but > a bit worried about showing my ignorance... I can only imagine it means an > estimate of the non-centrality parameter in which case it is a sensible > thing to have available since it is essentially the signal-to-noise ratio. > Actually the MLE is the F-statistic but the maximum *marginal* likelihood > estimate (based on the marginal distribution of the F-statistic itself) is > of more interest as it is closer to unbiased. In the case of the multiple > correlation coefficient, for example, this is (practically) what people call > the "adjusted R^2" statistic, where the adjustment is essentially a bias > correction. You can come up with simple analogues for non-central > chi-squared and non-central F of course, but they are again just simple > linear adjustments, unless you really want to get flash. (I wrote a couple > of papers on this stuff in the 70s so I have a kind of nostalgic affinity > for it...) > > I would be more interested in these quantities optionally appearing > routinely on summary tables than, for example, the cute ''significance > stars''. But as for calling them the "observed power", I would definitely > caution against that. It encourages entirely the wrong idea of what power > really is. (For example, it is a function, not a quantity, and you don''t > ever "observe" it in practice.) > > Bill Venables. > -- > Bill Venables, CSIRO/CMIS Environmetrics Project > Email: Bill.Venables at cmis.csiro.au > Phone: +61 7 3826 7251 > Fax: +61 7 3826 7304 > Postal: PO Box 120, Cleveland, Qld 4163, AUSTRALIA > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
David W <dwinsemius at home.com> writes:> Two or three years ago there was an extended discussion on > sci.stat.consult concerning "post-hoc power analysis". If > memory serves (since DejaNews is not currently allowing > searches back that far), it was power estimation using the > sample estimate of the variance done after conducting a > "failed" experiment . Some of the contributors did not seem > to understand that the variance was subject to sampling > error. Using the observed interim sample variance to > determine a plausible number of additional subjects would > seem of some use after an experiment of insufficient size > had testing consistent with the null. (With appropriate > regard for adjusting alpha after multiple tests.) It > doesn''t need to be distinguished by a separate term, and any > reasonable interpretation would already be subsumed under > existing interim analysis strategies....> > | What''s "observed power"? If you mean the item that SPSS has by that > > | name, I think you first have to convince us that that is a sensible > > | thing to calculate... > > > > If you ever do find out, Peter, let me know too, please. I was puzzled, but > > a bit worried about showing my ignorance... I can only imagine it means an > > estimate of the non-centrality parameter in which case it is a sensible > > thing to have available since it is essentially the signal-to-noise ratio. > > Actually the MLE is the F-statistic but the maximum *marginal* likelihood > > estimate (based on the marginal distribution of the F-statistic itself) is > > of more interest as it is closer to unbiased. In the case of the multiple > > correlation coefficient, for example, this is (practically) what people call > > the "adjusted R^2" statistic, where the adjustment is essentially a bias > > correction. You can come up with simple analogues for non-central > > chi-squared and non-central F of course, but they are again just simple > > linear adjustments, unless you really want to get flash. (I wrote a couple > > of papers on this stuff in the 70s so I have a kind of nostalgic affinity > > for it...) > > > > I would be more interested in these quantities optionally appearing > > routinely on summary tables than, for example, the cute ''significance > > stars''. But as for calling them the "observed power", I would definitely > > caution against that. It encourages entirely the wrong idea of what power > > really is. (For example, it is a function, not a quantity, and you don''t > > ever "observe" it in practice.)My understanding of what SPSS does is that it uses an estimate of the noncentrality and of the variance and plugs it into the usual power formulas. So for a t test with p just under 0.05, it comes out with an "observed power" of about 0.50 (so it''s not really significant or what?). Worse, for near-zero effects it comes out with a very low power, leading to pernicious nonsense of the type "we (or they) didn''t see an effect, but the study had low power to detect it". One common task in consulting is to explain to people that power calculations belong *before* the experiment was conducted and that once data are collected, confidence intervals make better sense. I''m not quite sure exactly what SPSS is doing to get the noncentrality parameters, but finding an example with p=0.05 and obs.power=0.50 exactly, would indicate that it is using the F statistic itself as the estimate. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /''_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello: Here is my current version info: platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 2.1 year 2001 month 01 day 15 language R I am using NT 4.0. Modifying some C code I originally did under R version 1.1.1, I find in the R Extensions manual (p. 34), that I need to change STRING to STRING_ELT VECTOR to VECTOR_ELT etc. I am using VC++ 6.0, and I simply cannot get that change to work. I am going to just give a simple example which shows what is happening. This example uses the getAttrib() and getListElement() functions which appear in many source files. It works perfectly on 1.1.1, but gives an unread memory error under 1.2.0. Am I doing something wrong here? First, a revised getListElement function, as suggested in the manual: static SEXP getListElement(SEXP list, char *str) { SEXP elmt = R_NilValue; SEXP names = getAttrib(list, R_NamesSymbol); int i; for (i = 0; i < length(list); i++) #if R_VERSION < R_Version(1, 2, 0) if (strcmp(CHAR(STRING(names)[i]), str) == 0) { elmt = VECTOR(list)[i]; break; } #else if (strcmp(CHAR(STRING_ELT(names,i)), str) == 0) { elmt = VECTOR_ELT(list,i); break; } #endif return elmt; } Now, a simple calling function, called foo(), for Windows: __declspec (dllexport) SEXP foo(SEXP input) { SEXP L,V,tmp; input = CDR(input);L = CAR(input); input = CDR(input);V = CAR(input); tmp = getListElement(L, "b"); return tmp; } I want to feed foo() a list and vector in R, so I made the R function foo <- function(L,V){res <- .External("foo",L,V);res} and I called> foo(list(a=4,b=6),c(2,4,9))This command yields 6, as it should, in version 1.1.1, but crashes version 1.2.1, with a "memory not read". If you''re still reading at this point, please note that I placed the two C functions in a source file, and at the top I included: #define VC #include <math.h> #include <R.h> #include "Defn.h" #include <Rdefines.h> Is there something obvious here that I''m missing? thanks in advance. Tom Richards -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
What has this to do with `observed power''? On Mon, 29 Jan 2001, Richards, Tom wrote:> Hello: > > Here is my current version info: > > platform i386-pc-mingw32 > arch x86 > os Win32 > system x86, Win32 > status > major 1 > minor 2.1 > year 2001 > month 01 > day 15 > language R > > I am using NT 4.0. Modifying some C code I originally did under R version > 1.1.1, I find in the R Extensions manual (p. 34), that I need to change > > STRING to STRING_ELT > VECTOR to VECTOR_ELT > etc. > > I am using VC++ 6.0, and I simply cannot get that change to work. I am > going to just give a simple example which shows what is happening. This > example uses the getAttrib() and getListElement() functions which appear in > many source files. It works perfectly on 1.1.1, but gives an unread memory > error under 1.2.0. Am I doing something wrong here? > > First, a revised getListElement function, as suggested in the manual: > > static SEXP getListElement(SEXP list, char *str) > { > SEXP elmt = R_NilValue; > SEXP names = getAttrib(list, R_NamesSymbol); > int i; > for (i = 0; i < length(list); i++) > #if R_VERSION < R_Version(1, 2, 0) > if (strcmp(CHAR(STRING(names)[i]), str) == 0) > { > elmt = VECTOR(list)[i]; > break; > } > #else > if (strcmp(CHAR(STRING_ELT(names,i)), str) == 0) > { > elmt = VECTOR_ELT(list,i); > break; > } > #endif > return elmt; > } > > > Now, a simple calling function, called foo(), for Windows: > > __declspec (dllexport) SEXP foo(SEXP input) > { > SEXP L,V,tmp; > > input = CDR(input);L = CAR(input); > input = CDR(input);V = CAR(input); > > tmp = getListElement(L, "b"); > return tmp; > } > > I want to feed foo() a list and vector in R, so I made the R function > > foo <- function(L,V){res <- .External("foo",L,V);res} > > and I called > > > foo(list(a=4,b=6),c(2,4,9)) > > This command yields 6, as it should, in version 1.1.1, but crashes version > 1.2.1, with a "memory not read". > > If you''re still reading at this point, please note that I placed the two C > functions in a source file, and at the top I included: > > #define VC > > #include <math.h> > #include <R.h> > #include "Defn.h" > #include <Rdefines.h>Don''t use Defn.h! It is not a shipped file and is not for casual use. Quite possibly the problem. You did not tell us how you linked this to make a DLL. Using the tools that come with 1.2.1 and the recommend compiler, this works for me if the non-existent Defn.h is omitted.> Is there something obvious here that I''m missing? thanks in advance. > > Tom Richards > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I am missing the Rcmd command needed for installing packages in R. Does anyone know where I can get this? It is not in the usual place with the other R binaries. If there is another way to install packages in windows, please let me know. This went seamlessly on my Linux and Unix builds. Thanks, Dan =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-Dan Powers Associate Professor, Sociology University of Texas at Austin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 29 Jan 2001, Daniel A. Powers wrote:> I am missing the Rcmd command needed for installing packages in R. Does > anyone know where I can get this? It is not in the usual place with the > other R binaries. If there is another way to install packages in windows,You need it to build packages from souces, and it *is* in the zip file for building packages from source, together with everything else you need from R and instructions. It is *not* needed to install binary packages.> please let me know. This went seamlessly on my Linux and Unix builds.Try reading the ReadMe in the directory you go the other parts from: The distribution consists of several zip files: rw1021b1.zip and rw1021b2.zip the base system rw1021h.zip text help rw1021ch.zip compiled HTML help rw1021w.zip HTML help files rw1021wh.zip Standard Windows help files rw1021l.zip latex help for offline help rw1021d1.zip PDF manuals except rw1021d2.zip PDF version of the reference manual rw1021sp.zip files to install from source packages -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Daniel A. Powers" wrote:> > I am missing the Rcmd command needed for installing packages in R. Does > anyone know where I can get this? It is not in the usual place with the > other R binaries.It is in R''s /bin directory, if you have got a recent version (e.g. R-1.2.1).> If there is another way to install packages in windows, > please let me know. This went seamlessly on my Linux and Unix builds.Yes. Rinst.exe is the recommended R installer for binary packages. More details in the FAQs. Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._