R/apaRegressionBootTable.R
apa.reg.boot.table.RdCreates a regresion table in APA style with bootstrap confidence intervals
apa.reg.boot.table(..., filename = NA, table.number = NA, number.samples = 1000)
| ... | Regression (i.e., lm) result objects. Typically, one for each block in the regression. |
|---|---|
| filename | (optional) Output filename document filename (must end in .rtf or .doc only) |
| table.number | Integer to use in table number output line |
| number.samples | Number of samples to create for bootstrap CIs |
APA table object
Algina, J. Keselman, H.J. & Penfield, R.J. (2008). Note on a confidence interval for the squared semipartial correlation coefficient. Educational and Psychological Measurement, 68, 734-741.
#Note: number.samples = 50 below. # However, please use a value of 1000 or higher # View top few rows of goggles data set # from Discovering Statistics Using R set.seed(1) head(album)#> adverts sales airplay attract #> 1 10.256 330 43 10 #> 2 985.685 120 28 7 #> 3 1445.563 360 35 7 #> 4 1188.193 270 33 7 #> 5 574.513 220 44 5 #> 6 568.954 170 19 5# Single block example blk1 <- lm(sales ~ adverts + airplay, data=album)apa.reg.boot.table(blk1)#> #> #> apa.reg.boot.table is a beta version. #> Block 1: Generating 1000 bootstrap samples #> Bootstrap for Delta RSQ in progress#> #> #> Regression results using sales as the criterion #> #> #> Predictor b b_95%_CI beta beta_95%_CI sr2 sr2_95%_CI r #> (Intercept) 41.12** [21.32, 58.54] #> adverts 0.09** [0.07, 0.10] 0.52 [0.43, 0.61] .27 [.19, .37] .58** #> airplay 3.59** [2.95, 4.28] 0.55 [0.46, 0.63] .29 [.21, .39] .60** #> #> #> #> Fit #> #> #> #> R2 = .629** #> 95% CI[.56,.70] #> #> #> Note. A significant b-weight indicates the beta-weight and semi-partial correlation are also significant. #> b represents unstandardized regression weights. beta indicates the standardized regression weights. #> sr2 represents the semi-partial correlation squared. r represents the zero-order correlation. #> Square brackets are used to enclose the lower and upper limits of a confidence interval. #> * indicates p < .05. ** indicates p < .01. #> #>apa.reg.boot.table(blk1,filename="exRegTable.doc")#> #> #> apa.reg.boot.table is a beta version. #> Block 1: Generating 1000 bootstrap samples #> Bootstrap for Delta RSQ in progress#> #> #> Regression results using sales as the criterion #> #> #> Predictor b b_95%_CI beta beta_95%_CI sr2 sr2_95%_CI r #> (Intercept) 41.12** [22.68, 56.86] #> adverts 0.09** [0.07, 0.10] 0.52 [0.43, 0.60] .27 [.18, .36] .58** #> airplay 3.59** [2.99, 4.22] 0.55 [0.46, 0.63] .29 [.21, .40] .60** #> #> #> #> Fit #> #> #> #> R2 = .629** #> 95% CI[.56,.70] #> #> #> Note. A significant b-weight indicates the beta-weight and semi-partial correlation are also significant. #> b represents unstandardized regression weights. beta indicates the standardized regression weights. #> sr2 represents the semi-partial correlation squared. r represents the zero-order correlation. #> Square brackets are used to enclose the lower and upper limits of a confidence interval. #> * indicates p < .05. ** indicates p < .01. #> #># Two block example, more than two blocks can be used blk1 <- lm(sales ~ adverts, data=album) blk2 <- lm(sales ~ adverts + airplay + attract, data=album)apa.reg.boot.table(blk1,blk2,filename="exRegBlocksTable.doc")#> #> #> apa.reg.boot.table is a beta version. #> Block 1: Generating 1000 bootstrap samples #> Block 2: Generating 1000 bootstrap samples #> Bootstrap for Delta RSQ in progress#> #> #> Regression results using sales as the criterion #> #> #> Predictor b b_95%_CI beta beta_95%_CI sr2 sr2_95%_CI r #> (Intercept) 134.14** [118.96, 149.22] #> adverts 0.10** [0.08, 0.11] 0.58 [0.48, 0.66] .33 [.23, .44] .58** #> #> #> #> (Intercept) -26.61 [-54.63, 10.71] #> adverts 0.08** [0.07, 0.10] 0.51 [0.42, 0.59] .26 [.17, .35] .58** #> airplay 3.37** [2.72, 3.96] 0.51 [0.43, 0.60] .25 [.17, .34] .60** #> attract 11.09** [6.04, 14.82] 0.19 [0.10, 0.27] .04 [.01, .07] .33** #> #> #> #> Fit Difference #> #> #> R2 = .335** #> 95% CI[.23,.44] #> #> #> #> #> #> R2 = .665** Delta R2 = .330** #> 95% CI[.60,.73] 95% CI[.23, .43] #> #> #> Note. A significant b-weight indicates the beta-weight and semi-partial correlation are also significant. #> b represents unstandardized regression weights. beta indicates the standardized regression weights. #> sr2 represents the semi-partial correlation squared. r represents the zero-order correlation. #> Square brackets are used to enclose the lower and upper limits of a confidence interval. #> * indicates p < .05. ** indicates p < .01. #> #># Interaction product-term test with blocks blk1 <- lm(sales ~ adverts + airplay, data=album) blk2 <- lm(sales ~ adverts + airplay + I(adverts * airplay), data=album)apa.reg.boot.table(blk1,blk2,filename="exInteraction1.doc")#> #> #> apa.reg.boot.table is a beta version. #> Block 1: Generating 1000 bootstrap samples #> Block 2: Generating 1000 bootstrap samples #> sr2 CI lower bound(s) adjusted to zero as per Algina, Keselman, & Penfield (2008) #> #> Bootstrap for Delta RSQ in progress #> Delta R2 CI lower bound adjusted to zero as per Algina, Keselman, & Penfield (2008) #>#> #> #> Regression results using sales as the criterion #> #> #> Predictor b b_95%_CI beta beta_95%_CI sr2 sr2_95%_CI #> (Intercept) 41.12** [21.93, 59.02] #> adverts 0.09** [0.07, 0.10] 0.52 [0.43, 0.60] .27 [.18, .36] #> airplay 3.59** [2.97, 4.21] 0.55 [0.45, 0.63] .29 [.20, .39] #> #> #> #> (Intercept) 28.30* [-3.47, 54.37] #> adverts 0.11** [0.06, 0.16] 0.69 [0.38, 0.97] .05 [.01, .09] #> airplay 4.02** [3.06, 5.17] 0.61 [0.47, 0.77] .15 [.08, .23] #> I(adverts * airplay) -0.00 [-0.00, 0.00] -0.19 [-0.52, 0.16] .00 [.00, .02] #> #> #> #> r Fit Difference #> #> .58** #> .60** #> R2 = .629** #> 95% CI[.56,.70] #> #> #> .58** #> .60** #> #> R2 = .632** Delta R2 = .003 #> 95% CI[.56,.70] 95% CI[.00, .02] #> #> #> Note. A significant b-weight indicates the beta-weight and semi-partial correlation are also significant. #> b represents unstandardized regression weights. beta indicates the standardized regression weights. #> sr2 represents the semi-partial correlation squared. r represents the zero-order correlation. #> Square brackets are used to enclose the lower and upper limits of a confidence interval. #> * indicates p < .05. ** indicates p < .01. #> #>