R version 4.0.4 (2021-02-15) -- "Lost Library Book" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(pwr) Warning message: package �pwr� was built under R version 4.0.5 #one sample t test pwr.t.test(d=0.80, sig.level=0.05, power=0.80, type="one.sample", alternative="greater") #One-sample t test power calculation # n = 11.14424 d = 0.8 # sig.level = 0.05 power = 0.8 # alternative = greater pwr.t.test(d=0.50, sig.level=0.05, power=0.80, type="one.sample", alternative="two.sided") # One-sample t test power calculation # n = 33.36713 d = 0.5 # sig.level = 0.05 # power = 0.8 # alternative = two.sided pwr.t.test(d=0.5, sig.level=0.05, power=0.80, type="two.sample", alternative="greater") # Two-sample t test power calculation # n = 50.1508 d = 0.5 # sig.level = 0.05 # power = 0.8 # alternative = greater #NOTE: n is number in *each* group pwr.t.test(d=1.37, sig.level=0.05, power=0.80, type="two.sample") # Two-sample t test power calculation # n = 9.427959 # d = 1.37 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: n is number in *each* group > pwr.t.test(d=-0.14, sig.level=0.05, power=0.80, type="two.sample", alternative="two-sided") Error in match.arg(alternative) : 'arg' should be one of �two.sided�, �less�, �greater� pwr.t.test(d=-0.14, sig.level=0.05, power=0.80, type="two.sample") # Two-sample t test power calculation # n = 801.8656 # d = 0.14 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: n is number in *each* group pwr.t.test(d=0.8, sig.level=0.05, power=0.80, type="paired", alternative="greater") # Paired t test power calculation n = 11.14424 # d = 0.8 # sig.level = 0.05 # power = 0.8 # alternative = greater #NOTE: n is number of *pairs* pwr.t.test(d=0.47, sig.level=0.05, power=0.80, type="paired", alternative="greater") # Paired t test power calculation # n = 29.38919 # d = 0.47 # sig.level = 0.05 # power = 0.8 # alternative = greater #NOTE: n is number of *pairs* pwr.t.test(d=0.47, sig.level=0.05, power=0.80, type="paired") # Paired t test power calculation # n = 37.49736 # d = 0.47 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: n is number of *pairs* pwr.t.test(d=0.25, sig.level=0.05, power=0.80, type="paired", alternative="two.sided") # Paired t test power calculation # n = 127.5158 # d = 0.25 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: n is number of *pairs* pwr.t.test(d=0.25, sig.level=0.05, power=0.80, type="paired") # Paired t test power calculation # n = 127.5158 # d = 0.25 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: n is number of *pairs* pwr.anova.test(k =6 , f =0.1 , sig.level=0.05 , power =0.80) # Balanced one-way analysis of variance power calculation # k = 6 # n = 214.7178 # f = 0.1 # sig.level = 0.05 # power = 0.8 #NOTE: n is number in each group pwr.anova.test(k =6 , f =0.25 , sig.level=0.05 , power =0.80) # Balanced one-way analysis of variance power calculation # k = 6 # n = 35.14095 # f = 0.25 # sig.level = 0.05 # power = 0.8 #NOTE: n is number in each group pwr.anova.test(k =5 , f =0.25 , sig.level=0.05 , power =0.80 ) # Balanced one-way analysis of variance power calculation # k = 5 # n = 39.1534 # f = 0.25 # sig.level = 0.05 # power = 0.8 #NOTE: n is number in each group pwr.2p.test(h=0.2, sig.level=0.05, power=.80, alternative="two.sided") # Difference of proportion power calculation for binomial distribution (arcsine transformation) # h = 0.2 # n = 392.443 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: same sample sizes pwr.2p.test(h=-0.21, sig.level=0.05, power=0.80, alternative="two.sided") # Difference of proportion power calculation for binomial distribution (arcsine transformation) # h = 0.21 # n = 355.9574 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: same sample sizes pwr.2p.test(h=-0.21, sig.level=0.05, power=0.80) # Difference of proportion power calculation for binomial distribution (arcsine transformation) # h = 0.21 # n = 355.9574 # sig.level = 0.05 # power = 0.8 # alternative = two.sided #NOTE: same sample sizes pwr.2p.test(h=0.25, sig.level=0.05, power=0.80, alternative="greater") # Difference of proportion power calculation for binomial distribution (arcsine transformation) # h = 0.25 # n = 197.8418 # sig.level = 0.05 # power = 0.8 # alternative = greater #NOTE: same sample sizes pwr.chisq.test(w=0.3, df=3, sig.level=0.05, power=0.80) # Chi squared power calculation # w = 0.3 # N = 121.1396 # df = 3 # sig.level = 0.05 # power = 0.8 #NOTE: N is the number of observations > ###NON PARAMETRICS #ONE SAMPLE-T TEST# pwr.t.test(d=0.5, sig.level=0.05, power=0.80, type="one.sample", alternative="greater") round(26.13753*1.15,0) #mann-whitney u test pwr.t.test(d=0.2, sig.level=0.05, power=0.80, type="two.sample", alternative="two.sided") round(198.1508*1.15,0) #wilcoxon sign test pwr.t.test(d=0.8, sig.level=0.05, power=0.80, type="paired", alternative="greater") male_protein<-c(1.8, 5.8, 7.1, 4.6, 5.5, 2.4, 8.3, 1.2) male_protein mean(male_protein) female_protein<-c(9.5, 2.6, 3.7, 4.7, 6.4, 8.4, 3.1, 1.4) female_protein mean(female_protein)