Title: | Log-Analytic Methods for Multiplicative Effects |
---|---|
Description: | Log-analytic methods intended for testing multiplicative effects. |
Authors: | Qimin Liu [aut, cre] |
Maintainer: | Qimin Liu <[email protected]> |
License: | GPL-3 |
Version: | 0.0.1 |
Built: | 2025-02-23 04:16:31 UTC |
Source: | https://github.com/qmmmmliu/lamme |
the AIC comparison with Modified Box-Cox Transformation (ABC) is a diagnostic procedure to help select among various additive and multiplicative models
abc(y, g, x = 0)
abc(y, g, x = 0)
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. |
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.
AIC results of different models. The model with smallest AIC is preferred.
data("schoene") attach(schoene) abc(post_HRT,group,pre_HRT) abc(post_HRT,group)
data("schoene") attach(schoene) abc(post_HRT,group,pre_HRT) abc(post_HRT,group)
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.
boot.es(y, g, x = 0, nrep = 1000, alpha = 0.05)
boot.es(y, g, x = 0, nrep = 1000, alpha = 0.05)
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) |
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 |
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.
data("schoene") attach(schoene) boot.es(post_HRT,group,pre_HRT,1000,.05)
data("schoene") attach(schoene) boot.es(post_HRT,group,pre_HRT,1000,.05)
Log-Analytic Methods for Multiplicative Effects
The lamme
package is designed to test and estimate multiplicative effects
via log-analytic methods.
To access this package's tutorial, type the following line into the console:
vignette("lamme-vignette")
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.
lancova(y, g, x, plot = F)
lancova(y, g, x, plot = F)
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) |
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.
data("schoene") attach(schoene) lancova(post_HRT,group,pre_HRT)
data("schoene") attach(schoene) lancova(post_HRT,group,pre_HRT)
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.
lanova(y, g, plot = F)
lanova(y, g, plot = F)
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) |
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.
# 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)
# 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)
Compute the statistical power of the LANCOVA test.
pwr.lancova(k, n, r_sqrd, rho_sqrd, alpha = 0.05)
pwr.lancova(k, n, r_sqrd, rho_sqrd, alpha = 0.05)
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) |
power |
the statistical power of test |
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
pwr.lancova(3,40,.1,.4,.05)
pwr.lancova(3,40,.1,.4,.05)
Compute the statistical power of the LANOVA test.
pwr.lanova(k, n, r_sqrd, alpha = 0.05)
pwr.lanova(k, n, r_sqrd, alpha = 0.05)
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) |
power |
the statistical power of test |
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
pwr.lanova(3,40,.4,.05)
pwr.lanova(3,40,.4,.05)
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.
data(schoene)
data(schoene)
A dataframe with 81 rows and 3 variables:
treatment or control group from experimental manipulation
prettest hand reaction time
posttest hand reaction time
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.
data(schoene) head(schoene) table(schoene$group)
data(schoene) head(schoene) table(schoene$group)
Compute the required per-group sample size for the LANCOVA test.
ss.lancova(k, rho_sqrd, r_sqrd, power = 0.8, alpha = 0.05)
ss.lancova(k, rho_sqrd, r_sqrd, power = 0.8, alpha = 0.05)
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) |
n |
the per-group sample size requirement |
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
ss.lancova(3,.5,.01,.14,.05)
ss.lancova(3,.5,.01,.14,.05)
Compute the required per-group sample size for the LANOVA test.
ss.lanova(k, r_sqrd, power = 0.8, alpha = 0.05)
ss.lanova(k, r_sqrd, power = 0.8, alpha = 0.05)
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) |
n |
the per-group sample size requirement |
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
ss.lanova(3,.01,.14,.05)
ss.lanova(3,.01,.14,.05)