Title: | Log-Analytic Methods for Multiplicative Effects |
Version: | 0.0.1 |
Description: | Log-analytic methods intended for testing multiplicative effects. |
Depends: | R (≥ 3.4.0) |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.0.9000 |
Suggests: | knitr, rmarkdown |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2018-09-29 05:13:02 UTC; qliu6 |
Author: | Qimin Liu [aut, cre] |
Maintainer: | Qimin Liu <qliu6@nd.edu> |
Repository: | CRAN |
Date/Publication: | 2018-10-06 23:00:06 UTC |
lamme
Description
Log-Analytic Methods for Multiplicative Effects
Details
The lamme
package is designed to test and estimate multiplicative effects
via log-analytic methods.
Usage
To access this package's tutorial, type the following line into the console:
vignette("lamme-vignette")
the ABC procedure for model selection
Description
the AIC comparison with Modified Box-Cox Transformation (ABC) is a diagnostic procedure to help select among various additive and multiplicative models
Usage
abc(y, g, x = 0)
Arguments
y |
the raw posttest scores of a continuous outcome variable. |
g |
the categorical variable that denotes the group membership. |
x |
(optional) the raw pretest scores of a continuous outcome variable. |
Details
When only 'y' and 'g' are specified, the ABC procedure compares LANOVA and ANOVA models. When 'x' is also specified, the ABC procedure compares LANCOVA, ANCOVA, ANCOHET, and ANCOVA with log-transformed y.
Value
AIC results of different models. The model with smallest AIC is preferred.
Examples
data("schoene")
attach(schoene)
abc(post_HRT,group,pre_HRT)
abc(post_HRT,group)
Boostrapped CI for Effect Size measures
Description
Compute the bias-corrected and expanded percentile boostrapped confidence intervals for effect size estimates zetas and the overall signal-to-noise ratio. Additionally, if pretest scores are provided, boostrapped CI on beta is also given.
Usage
boot.es(y, g, x = 0, nrep = 1000, alpha = 0.05)
Arguments
y |
the raw posttest scores of a continuous outcome variable. |
g |
the categorical variable that denotes the group membership. |
x |
(optional) the raw pretest scores of a continuous outcome variable. |
nrep |
the number of boostrapped samples. (default=1000) |
alpha |
the significance level (default=.05) |
Value
a table of lower and upper limit from bias-corrected and accelerated and expanded percentile boostrapped confidence interval. The first row is on the geometric mean of the control group (default group of comparison). After that, zeta estimates are given of the each respective group versus the control group (default group of comparison). Then, if pretest scores are given, CI on the beta estimate is given. Lastly, CI on the signal-to-noise ratio, an overall effect size measure, is provided.
BCa LL |
the lower limit of the Bias-Corrected and accelerated boostrapped Confidence Interval |
BCa UL |
the upper limit of the Bias-Corrected and accelerated boostrapped Confidence Interval |
exp LL |
the lower limit of the expanded percentile boostrapped Confidence Interval |
exp UL |
the upper limit of the expanded percentile boostrapped Confidence Interval |
References
Efron, B. (1987). "Better Bootstrap Confidence Intervals". Journal of the American Statistical Association. Journal of the American Statistical Association, Vol. 82, No. 397. 82 (397): 171–185. doi:10.2307/2289144. JSTOR 2289144.
Examples
data("schoene")
attach(schoene)
boot.es(post_HRT,group,pre_HRT,1000,.05)
Logged ANCOVA
Description
Mathematically, LANCOVA is the ANCOVA form of a log-log model where both the dependent variable and the covariate is log-transformed. LANCOVA can test and estimate multiplicative effects.
Usage
lancova(y, g, x, plot = F)
Arguments
y |
the raw posttest scores of a continuous outcome variable. |
g |
the categorical variable that denotes the group membership |
x |
the raw pretest scores of a continuous outcome variable. |
plot |
a TRUE/FALSE variable that denotes if diagnostic plots are desired. (default=F) |
Value
An summary object of the LANCOVA results. In residuals, the summary statistics are of sample multiplicative errors. In the coefficients table, the estimate of the intercept is the (control group) geometric mean estimate. The estimate for the pretest scores is the power parameter beta's estimate. Other coefficient estimates are effect size measure zeta's estimates. The standard error is on the logged scale. The confidence intervals are of significance level = .05 for the control group geometric mean and for the zeta estimates, respectively, of the intercept and other coefficients The residual standard error is that of the logged scale residuals. Both R-squared and Adjusted R-squared are computed on the logged model. If 'plot=TRUE', diagnostic plots are provided.
Examples
data("schoene")
attach(schoene)
lancova(post_HRT,group,pre_HRT)
Logged ANOVA
Description
Mathematically, LANOVA is the ANOVA form of a log-log model where the dependent variable is log-transformed. LANOVA can test and estimate multiplicative effects.
Usage
lanova(y, g, plot = F)
Arguments
y |
the raw scores of a continuous outcome variable. |
g |
a categorical variable that denotes the group membership. |
plot |
a TRUE/FALSE variable that denotes if diagnostic plots are desired. (default=F) |
Value
An summary object of the LANOVA results. In residuals, the summary statistics are of sample multiplicative errors. In the coefficients table, the estimate of the intercept is the default group (control group) geometric mean estimate. Other coefficient estimates are effect size measure zeta's estimates. The standard error is on the logged scale. The confidence intervals are of significance level = .05 for the control group geometric mean and for the zeta estimates, respectively, of the intercept and other coefficients The residual standard error is that of the logged scale residuals. Both R-squared and Adjusted R-squared are computed on the logged model. If 'plot=TRUE', diagnostic plots are provided.
Examples
# generate data
y1=rnorm(1000,5,1)+rnorm(1000)
y2=rnorm(1000,5.5,1)+rnorm(1000)
y3=rnorm(1000,6,1)+rnorm(1000)
y1=exp(y1)
y2=exp(y2)
y3=exp(y3)
dep=c(y1,y2,y3)
tc=rep(c(0,1,2),each=1000)
# applying lanova with the generated data
lanova(dep,tc)
Power Calculation for LANCOVA
Description
Compute the statistical power of the LANCOVA test.
Usage
pwr.lancova(k, n, r_sqrd, rho_sqrd, alpha = 0.05)
Arguments
k |
the number of groups. |
n |
the number of observations per group. |
r_sqrd |
the expected explained variance (on the logged scale) |
rho_sqrd |
the pretest-posttest correlation |
alpha |
the significance level (default=.05) |
Value
power |
the statistical power of test |
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
Examples
pwr.lancova(3,40,.1,.4,.05)
Power Calculation for LANOVA
Description
Compute the statistical power of the LANOVA test.
Usage
pwr.lanova(k, n, r_sqrd, alpha = 0.05)
Arguments
k |
the number of groups. |
n |
the number of observations per group. |
r_sqrd |
the expected explained variance (on the logged scale) |
alpha |
the significance level (default=.05) |
Value
power |
the statistical power of test |
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
Examples
pwr.lanova(3,40,.4,.05)
Data on Interactive Cognitive-Motor Step Training
Description
Data from a randomized controlled trial on Interactive cognitive-motor step training. 81 observations are included. The outcome variable included is the hand reaction time. The data come from a randomzied pretest-posttest design with control and treatment groups.
Usage
data(schoene)
Format
A dataframe with 81 rows and 3 variables:
- group
treatment or control group from experimental manipulation
- pre_HRT
prettest hand reaction time
- post_HRT
posttest hand reaction time
References
Schoene D, Valenzuela T, Toson B, Delbaere K, Severino C, Garcia J, et al. (2015) Interactive Cognitive-Motor Step Training Improves Cognitive Risk Factors of Falling in Older Adults – A Randomized Controlled Trial. PLoS ONE 10(12): e0145161.
Examples
data(schoene)
head(schoene)
table(schoene$group)
Sample Size Planning for LANCOVA
Description
Compute the required per-group sample size for the LANCOVA test.
Usage
ss.lancova(k, rho_sqrd, r_sqrd, power = 0.8, alpha = 0.05)
Arguments
k |
the number of groups. |
rho_sqrd |
the pretest-posttest correlation |
r_sqrd |
the expected explained variance by the model (on the logged scale) |
power |
the desired statistical power (default=.8) |
alpha |
the significance level (default=.05) |
Value
n |
the per-group sample size requirement |
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
Examples
ss.lancova(3,.5,.01,.14,.05)
Sample Size Planning for LANOVA
Description
Compute the required per-group sample size for the LANOVA test.
Usage
ss.lanova(k, r_sqrd, power = 0.8, alpha = 0.05)
Arguments
k |
the number of groups. |
r_sqrd |
the expected explained variance (on the logged scale) |
power |
the desired statistical power (default=.8) |
alpha |
the significance level (default=.05) |
Value
n |
the per-group sample size requirement |
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
Examples
ss.lanova(3,.01,.14,.05)