Sabemos el N, la diferencia, pero desconocemos el poder
pwr.anova.test(
k = 2,
n = 8,
f = 0.6,
sig.level = 0.05,
power = NULL # lo que deseamos despejar
)
Balanced one-way analysis of variance power calculation
k = 2
n = 8
f = 0.6
sig.level = 0.05
power = 0.6078185
NOTE: n is number in each group
Conclusión: el estudio tiene una muestra menor a la requerida. Es muy probable que haya un error tipo II en los resultados
Sabemos la diferencia clínicamente significativa y el poder. ¿Cuántos pacientes incluir?
pwr.anova.test(
k = 2,
n = NULL, # lo que deseamos despejar
f = 0.6,
sig.level = 0.05,
power = 0.8
)
Balanced one-way analysis of variance power calculation
k = 2
n = 11.94226
f = 0.6
sig.level = 0.05
power = 0.8
NOTE: n is number in each group
necesitamos once pacientes por grupo
table(muestra2)
muestra2
Enfermos Sanos
32 68
prop.test(s,t)
2-sample test for equality of proportions with continuity correction
data: s out of t
X-squared = 2.0247, df = 1, p-value = 0.1548
alternative hypothesis: two.sided
95 percent confidence interval:
-0.03006994 0.17006994
sample estimates:
prop 1 prop 2
0.32 0.25
table(poblacion)
poblacion
Enfermos Sanos
100 900
table(muestra2)
muestra2
Enfermos Sanos
1 9
prop.test(s,t)
2-sample test for equality of proportions with continuity correction
data: s out of t
X-squared = 2.0247, df = 1, p-value = 0.1548
alternative hypothesis: two.sided
95 percent confidence interval:
-0.03006994 0.17006994
sample estimates:
prop 1 prop 2
0.32 0.25
addmargins(datos)
Adhesivas No adhesivas Sum
Éxito 18 15 33
Fracaso 2 4 6
Sum 20 19 39
chisq.test(datos) #NS
Chi-squared approximation may be incorrect
Pearson's Chi-squared test with Yates' continuity correction
data: datos
X-squared = 0.26241, df = 1, p-value = 0.6085
addmargins(datos)
Adhesivas No adhesivas Sum
Éxito 180 150 330
Fracaso 20 40 60
Sum 200 190 390
chisq.test(datos) #SIG
Pearson's Chi-squared test with Yates' continuity correction
data: datos
X-squared = 8.3142, df = 1, p-value = 0.003934
pwr.p.test(
h = 0.2,
n = 20,
sig.level = 0.05,
power = NULL,
alternative = "two.sided"
)
proportion power calculation for binomial distribution (arcsine transformation)
h = 0.2
n = 20
sig.level = 0.05
power = 0.1454725
alternative = two.sided
pwr.p.test(
h = 0.2,
n = NULL,
sig.level = 0.05,
power = 0.80,
alternative = "two.sided"
)
proportion power calculation for binomial distribution (arcsine transformation)
h = 0.2
n = 196.2215
sig.level = 0.05
power = 0.8
alternative = two.sided
pwr.t.test(
n = NULL,
d = 0.5,
sig.level = 0.05,
power = 0.8,
type = c("two.sample")
)
Two-sample t test power calculation
n = 63.76561
d = 0.5
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group
pwr.t.test(
n = NULL,
d = 0.5,
sig.level = 0.05,
power = 0.8,
type = c("paired")
)
Paired t test power calculation
n = 33.36713
d = 0.5
sig.level = 0.05
power = 0.8
alternative = two.sided
NOTE: n is number of *pairs*
pwr.anova.test(
k = 3,
n= 10,
f=0.25,
power = NULL,
sig.level = 0.05
)
Balanced one-way analysis of variance power calculation
k = 3
n = 10
f = 0.25
sig.level = 0.05
power = 0.1951401
NOTE: n is number in each group
pwr.anova.test(
k = 3,
n = NULL,
f = 0.25,
power = 0.8,
sig.level = 0.05
)
Balanced one-way analysis of variance power calculation
k = 3
n = 52.3966
f = 0.25
sig.level = 0.05
power = 0.8
NOTE: n is number in each group
install.packages("statmod")
Installing package into ‘/home/sergiouribe/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
probando la URL 'https://cran.rstudio.com/src/contrib/statmod_1.4.30.tar.gz'
Content type 'application/x-gzip' length 57309 bytes (55 KB)
==================================================
downloaded 55 KB
* installing *source* package ‘statmod’ ...
** package ‘statmod’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -c gaussq2.f -o gaussq2.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o statmod.so gaussq2.o init.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /home/sergiouribe/R/x86_64-pc-linux-gnu-library/3.4/statmod/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (statmod)
The downloaded source packages are in
‘/tmp/RtmpzH45u9/downloaded_packages’
power.fisher.test(0.5,0.9,20,20)
[1] 0.78