betaMC: Example Using the BetaMC Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-beta-mc.Rmd
example-beta-mc.Rmd
In this example, a multiple regression model is fitted using program
quality ratings (QUALITY
) as the regressand/outcome
variable and number of published articles attributed to the program
faculty members (NARTIC
), percent of faculty members
holding research grants (PCTGRT
), and percentage of program
graduates who received support (PCTSUPP
) as
regressor/predictor variables using a data set from 1982 ratings of 46
doctoral programs in psychology in the USA (National Research Council, 1982). Confidence
intervals for the standardized regression coefficients are generated
using the BetaMC()
function from the betaMC
package.
df <- betaMC::nas1982
Regression
Fit the regression model using the lm()
function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
Monte Carlo Sampling Distribution of Parameters
Normal-Theory Approach
mvn <- MC(object, type = "mvn")
Asymptotic distribution-free Approach
adf <- MC(object, type = "adf")
Heteroskedasticity Consistent Approach (HC3)
hc3 <- MC(object, type = "hc3")
Standardized Regression Slopes
Normal-Theory Approach
mvn <- BetaMC(mvn)
Asymptotic distribution-free Approach
adf <- BetaMC(adf)
Heteroskedasticity Consistent Approach (HC3)
hc3 <- BetaMC(hc3)
Methods
summary
Summary of the results of BetaMC()
.
summary(mvn)
#> Call:
#> BetaMC(object = mvn)
#>
#> Standardized regression slopes
#> type = "mvn"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0762 20000 0.2324 0.2920 0.3391 0.6377 0.6796 0.7263
#> PCTGRT 0.3915 0.0773 20000 0.1424 0.1922 0.2371 0.5393 0.5919 0.6462
#> PCTSUPP 0.2632 0.0747 20000 0.0274 0.0758 0.1181 0.4077 0.4615 0.5244
summary(adf)
#> Call:
#> BetaMC(object = adf)
#>
#> Standardized regression slopes
#> type = "adf"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0677 20000 0.2581 0.3090 0.3518 0.6158 0.6558 0.6931
#> PCTGRT 0.3915 0.0711 20000 0.1342 0.1942 0.2413 0.5190 0.5581 0.6031
#> PCTSUPP 0.2632 0.0768 20000 0.0136 0.0596 0.1085 0.4084 0.4532 0.5068
summary(hc3)
#> Call:
#> BetaMC(object = hc3)
#>
#> Standardized regression slopes
#> type = "hc3"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0792 20000 0.2175 0.2710 0.3238 0.6336 0.6754 0.7240
#> PCTGRT 0.3915 0.0825 20000 0.0862 0.1623 0.2199 0.5434 0.5889 0.6537
#> PCTSUPP 0.2632 0.0861 20000 -0.0428 0.0243 0.0858 0.4259 0.4777 0.5290
vcov
Return the sampling covariance matrix.
vcov(mvn)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.005811264 -0.003377116 -0.002133562
#> PCTGRT -0.003377116 0.005977965 -0.001726979
#> PCTSUPP -0.002133562 -0.001726979 0.005577850
vcov(adf)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.004579400 -0.002533837 -0.001685874
#> PCTGRT -0.002533837 0.005058729 -0.001911362
#> PCTSUPP -0.001685874 -0.001911362 0.005892660
vcov(hc3)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.006273762 -0.003553762 -0.002012206
#> PCTGRT -0.003553762 0.006801337 -0.002366176
#> PCTSUPP -0.002012206 -0.002366176 0.007413123
confint
Return confidence intervals.
confint(mvn, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.3391226 0.6377052
#> PCTGRT 0.2370561 0.5393107
#> PCTSUPP 0.1180515 0.4077326
confint(adf, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.3517557 0.6158135
#> PCTGRT 0.2412963 0.5190199
#> PCTSUPP 0.1084907 0.4084212
confint(hc3, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.3237701 0.6335722
#> PCTGRT 0.2199157 0.5434295
#> PCTSUPP 0.0857911 0.4258634