Title: | Inferential Statistics |
---|---|
Description: | Select set of parametric and non-parametric statistical tests. 'inferr' builds upon the solid set of statistical tests provided in 'stats' package by including additional data types as inputs, expanding and restructuring the test results. The tests included are t tests, variance tests, proportion tests, chi square tests, Levene's test, McNemar Test, Cochran's Q test and Runs test. |
Authors: | Aravind Hebbali [aut, cre] |
Maintainer: | Aravind Hebbali <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.3.2.9000 |
Built: | 2024-11-11 15:15:06 UTC |
Source: | https://github.com/rsquaredacademy/inferr |
A dataset containing information about results of three exams.
exam
exam
A data frame with 15 rows and 3 variables:
result of exam1
result of exam2
result of exam3
https://www.spss-tutorials.com/spss-cochran-q-test/
A dataset containing demographic information and standardized test scores of high school students.
hsb
hsb
A data frame with 200 rows and 10 variables:
id of the student
gender of the student
ethnic background of the student
socio-economic status of the student
school type
program type
scores from test of reading
scores from test of writing
scores from test of math
scores from test of science
scores from test of social studies
https://nces.ed.gov/surveys/hsb/
Test whether the proportion of successes on a two-level categorical dependent variable significantly differs from a hypothesized value.
ifr_binom_calc(n, success, prob = 0.5, ...) ifr_binom_test(data, variable, prob = 0.5)
ifr_binom_calc(n, success, prob = 0.5, ...) ifr_binom_test(data, variable, prob = 0.5)
n |
number of observations |
success |
number of successes |
prob |
assumed probability of success on a trial |
... |
additional arguments passed to or from other methods |
data |
a |
variable |
factor; column in |
ifr_binom_test
returns an object of class "ifr_binom_test"
.
An object of class "ifr_binom_test"
is a list containing the
following components:
exp_k |
expected number of successes |
exp_p |
expected probability of success |
k |
number of successes |
n |
number of observations |
obs_p |
assumed probability of success |
pval_lower |
lower one sided p value |
pval_upper |
upper one sided p value |
infer_binom_calc()
and infer_binom_test()
have been deprecated. Instead use
ifr_binom_cal()
and ifr_binom_test()
.
Hoel, P. G. 1984. Introduction to Mathematical Statistics. 5th ed. New York: Wiley.
# using calculator ifr_binom_calc(32, 13, prob = 0.5) # using data set ifr_binom_test(hsb, female, prob = 0.5)
# using calculator ifr_binom_calc(32, 13, prob = 0.5) # using data set ifr_binom_test(hsb, female, prob = 0.5)
Chi Square test of association to examine if there is a relationship between two categorical variables.
ifr_chisq_assoc_test(data, x, y)
ifr_chisq_assoc_test(data, x, y)
data |
a |
x |
factor; column in |
y |
factor; column in |
ifr_chisq_assoc_test
returns an object of class
"ifr_chisq_assoc_test"
. An object of class
"ifr_chisq_assoc_test"
is a list containing the
following components:
chisquare |
chi square |
chisquare_lr |
likelihood ratio chi square |
chisquare_mantel_haenszel |
mantel haenszel chi square |
chisquare_adjusted |
continuity adjusted chi square |
contingency_coefficient |
contingency coefficient |
cramers_v |
cramer's v |
df |
degrees of freedom |
ds |
product of dimensions of the table of |
phi_coefficient |
phi coefficient |
pval_chisquare |
p-value of chi square |
pval_chisquare_adjusted |
p-value of continuity adjusted chi square |
pval_chisquare_lr |
p-value of likelihood ratio chi square |
pval_chisquare_mantel_haenszel |
p-value of mantel haenszel chi square |
infer_chisq_assoc_test()
has been deprecated. Instead use
ifr_chisq_assoc_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
ifr_chisq_assoc_test(hsb, female, schtyp) ifr_chisq_assoc_test(hsb, female, ses)
ifr_chisq_assoc_test(hsb, female, schtyp) ifr_chisq_assoc_test(hsb, female, ses)
Test whether the observed proportions for a categorical variable differ from hypothesized proportions
ifr_chisq_gof_test(data, x, y, correct = FALSE)
ifr_chisq_gof_test(data, x, y, correct = FALSE)
data |
a |
x |
factor; column in |
y |
expected proportions |
correct |
logical; if TRUE continuity correction is applied |
ifr_chisq_gof_test
returns an object of class
"ifr_chisq_gof_test"
. An object of class "ifr_chisq_gof_test"
is a list containing the following components:
categories |
levels of |
chisquare |
chi square statistic |
deviation |
deviation of observed from frequency |
degrees_of_freedom |
chi square degrees of freedom |
expected_frequency |
expected frequency/proportion |
n_levels |
number of levels of |
observed_frequency |
observed frequency/proportion |
pvalue |
p-value |
sample_size |
number of observations |
std_residuals |
standardized residuals |
varname |
name of categorical variable |
infer_chisq_gof_test()
has been deprecated. Instead use
ifr_chisq_gof_test()
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140)) # apply continuity correction ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140), correct = TRUE)
ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140)) # apply continuity correction ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140), correct = TRUE)
Test if the proportions of 3 or more dichotomous variables are equal in the same population.
ifr_cochran_qtest(data, ...)
ifr_cochran_qtest(data, ...)
data |
a |
... |
columns in |
ifr_cochran_qtest
returns an object of class
"ifr_cochran_qtest"
. An object of class "ifr_cochran_qtest"
is a list containing the following components:
df |
degrees of freedom |
n |
number of observations |
pvalue |
p value |
q |
cochran's q statistic |
infer_cochran_test()
has been deprecated. Instead use
ifr_cochran_qtest()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
ifr_cochran_qtest(exam, exam1, exam2, exam3)
ifr_cochran_qtest(exam, exam1, exam2, exam3)
Launches shiny app
ifr_launch_shiny_app()
ifr_launch_shiny_app()
infer_launch_shiny_app()
has been deprecated. Instead use ifr_launch_shiny_app()
.
## Not run: ifr_launch_shiny_app() ## End(Not run)
## Not run: ifr_launch_shiny_app() ## End(Not run)
ifr_levene_test
reports Levene's robust test statistic
for the equality of variances and the
two statistics proposed by Brown and Forsythe that replace the mean in
Levene's formula with alternative location estimators. The first alternative
replaces the mean with the median. The second alternative replaces
the mean with the 10
ifr_levene_test(data, ...) ## Default S3 method: ifr_levene_test(data, ..., group_var = NULL, trim_mean = 0.1)
ifr_levene_test(data, ...) ## Default S3 method: ifr_levene_test(data, ..., group_var = NULL, trim_mean = 0.1)
data |
a |
... |
numeric; columns in |
group_var |
factor; column in |
trim_mean |
trimmed mean |
ifr_levene_test
returns an object of class "ifr_levene_test"
.
An object of class "ifr_levene_test"
is a list containing the
following components:
bf |
Brown and Forsythe f statistic |
p_bf |
p-value for Brown and Forsythe f statistic |
lev |
Levene's f statistic |
p_lev |
p-value for Levene's f statistic |
bft |
Brown and Forsythe f statistic using trimmed mean |
p_bft |
p-value for Brown and Forsythe f statistic using trimmed mean |
avgs |
mean for each level of the grouping variable |
sds |
standard deviations for each level of the grouping variable |
avg |
combined mean |
sd |
combined standard deviation |
n |
number of observations |
n_df |
numerator degrees of freedom |
d_df |
denominator degrees of freedom |
levs |
levels of the grouping variable |
lens |
number of observations for each level of the grouping variable |
type |
alternative hypothesis |
infer_levene_test()
has been deprecated. Instead use ifr_levene_test()
.
Bland, M. 2000. An Introduction to Medical Statistics. 3rd ed. Oxford: Oxford University Press.
Brown, M. B., and A. B. Forsythe. 1974. Robust tests for the equality of variances. Journal of the American Statistical Association 69: 364–367.
Carroll, R. J., and H. Schneider. 1985. A note on Levene’s tests for equality of variances. Statistics and Probability Letters 3: 191–194.
# using grouping variable ifr_levene_test(hsb, read, group_var = race) # using variables ifr_levene_test(hsb, read, write, socst)
# using grouping variable ifr_levene_test(hsb, read, group_var = race) # using variables ifr_levene_test(hsb, read, write, socst)
Test if the proportions of two dichotomous variables are equal in the same population.
ifr_mcnemar_test(data, x = NULL, y = NULL)
ifr_mcnemar_test(data, x = NULL, y = NULL)
data |
a |
x |
factor; column in |
y |
factor; column in |
ifr_mcnemar_test
returns an object of class "ifr_mcnemar_test"
.
An object of class "ifr_mcnemar_test"
is a list containing the
following components:
statistic |
chi square statistic |
df |
degrees of freedom |
pvalue |
p-value |
exactp |
exact p-value |
cstat |
continuity correction chi square statistic |
cpvalue |
continuity correction p-value |
kappa |
kappa coefficient; measure of interrater agreement |
std_err |
asymptotic standard error |
kappa_cil |
95% kappa lower confidence limit |
kappa_ciu |
95% kappa upper confidence limit |
cases |
cases |
controls |
controls |
ratio |
ratio of proportion with factor |
odratio |
odds ratio |
tbl |
two way table |
infer_mcnermar_test()
has been deprecated. Instead use
ifr_mcnemar_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# using variables from data hb <- hsb hb$himath <- ifelse(hsb$math > 60, 1, 0) hb$hiread <- ifelse(hsb$read > 60, 1, 0) ifr_mcnemar_test(hb, himath, hiread) # test if the proportion of students in himath and hiread group is same himath <- ifelse(hsb$math > 60, 1, 0) hiread <- ifelse(hsb$read > 60, 1, 0) ifr_mcnemar_test(table(himath, hiread)) # using matrix ifr_mcnemar_test(matrix(c(135, 18, 21, 26), nrow = 2))
# using variables from data hb <- hsb hb$himath <- ifelse(hsb$math > 60, 1, 0) hb$hiread <- ifelse(hsb$read > 60, 1, 0) ifr_mcnemar_test(hb, himath, hiread) # test if the proportion of students in himath and hiread group is same himath <- ifelse(hsb$math > 60, 1, 0) hiread <- ifelse(hsb$read > 60, 1, 0) ifr_mcnemar_test(table(himath, hiread)) # using matrix ifr_mcnemar_test(matrix(c(135, 18, 21, 26), nrow = 2))
One way analysis of variance
ifr_oneway_anova(data, x, y, ...)
ifr_oneway_anova(data, x, y, ...)
data |
a |
x |
numeric; column in |
y |
factor; column in |
... |
additional arguments passed to or from other methods |
ifr_oneway_anova
returns an object of class "ifr_oneway_anova"
.
An object of class "ifr_oneway_anova"
is a list containing the
following components:
adjusted_r2 |
adjusted r squared value |
df_btw |
between groups degress of freedom |
df_within |
within groups degress of freedom |
df_total |
total degress of freedom |
fstat |
f value |
group_stats |
group statistics |
ms_btw |
between groups mean square |
ms_within |
within groups mean square |
obs |
number of observations |
pval |
p value |
r2 |
r squared value |
rmse |
root mean squared error |
ss_between |
between group sum of squares |
ss_within |
within group sum of squares |
ss_total |
total sum of squares |
infer_oneway_anova()
has been deprecated. Instead use
ifr_oneway_anova()
Kutner, M. H., Nachtsheim, C., Neter, J., & Li, W. (2005). Applied linear statistical models. Boston: McGraw-Hill Irwin.
ifr_oneway_anova(mtcars, mpg, cyl) ifr_oneway_anova(hsb, write, prog)
ifr_oneway_anova(mtcars, mpg, cyl) ifr_oneway_anova(hsb, write, prog)
ifr_os_prop_test
compares proportion in one group to a
specified population proportion.
ifr_os_prop_test( data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all") ) ## Default S3 method: ifr_os_prop_test( data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all") )
ifr_os_prop_test( data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all") ) ## Default S3 method: ifr_os_prop_test( data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all") )
data |
numeric vector of length 1 or a |
variable |
factor; column in |
prob |
hypothesised proportion |
phat |
observed proportion |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter. |
ifr_os_prop_test
returns an object of class "ifr_os_prop_test"
.
An object of class "ifr_os_prop_test"
is a list containing the
following components:
n |
number of observations |
phat |
proportion of 1's |
p |
assumed probability of success |
z |
z statistic |
sig |
p-value for z statistic |
alt |
alternative hypothesis |
obs |
observed number of 0's and 1's |
exp |
expected number of 0's and 1's |
deviation |
deviation of observed from expected |
std |
standardized resiudals |
infer_os_prop_test()
has been deprecated. Instead use ifr_os_prop_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# use as a calculator ifr_os_prop_test(200, prob = 0.5, phat = 0.3) # using data set ifr_os_prop_test(hsb, female, prob = 0.5)
# use as a calculator ifr_os_prop_test(200, prob = 0.5, phat = 0.3) # using data set ifr_os_prop_test(hsb, female, prob = 0.5)
ifr_os_t_test
performs t tests on the equality of means. It tests the
hypothesis that a sample has a mean equal to a hypothesized value.
ifr_os_t_test( data, x, mu = 0, alpha = 0.05, alternative = c("both", "less", "greater", "all"), ... )
ifr_os_t_test( data, x, mu = 0, alpha = 0.05, alternative = c("both", "less", "greater", "all"), ... )
data |
a |
x |
numeric; column in |
mu |
a number indicating the true value of the mean |
alpha |
acceptable tolerance for type I error |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter |
... |
additional arguments passed to or from other methods |
ifr_os_t_test
returns an object of class "ifr_os_t_test"
.
An object of class "ifr_os_t_test"
is a list containing the
following components:
mu |
a number indicating the true value of the mean |
n |
number of observations |
df |
degrees of freedom |
Mean |
observed mean of |
stddev |
standard deviation of |
std_err |
estimate of standard error |
test_stat |
t statistic |
confint |
confidence interval for the mean |
mean_diff |
mean difference |
mean_diff_l |
lower confidence limit for mean difference |
mean_diff_u |
upper confidence limit for mean difference |
p_l |
lower one-sided p-value |
p_u |
upper one-sided p-value |
p |
two sided p-value |
conf |
confidence level |
type |
alternative hypothesis |
var_name |
name of |
infer_os_t_test()
has been deprecated. Instead use ifr_os_t_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_os_t_test(hsb, write, mu = 50, alternative = 'less') # upper tail ifr_os_t_test(hsb, write, mu = 50, alternative = 'greater') # both tails ifr_os_t_test(hsb, write, mu = 50, alternative = 'both') # all tails ifr_os_t_test(hsb, write, mu = 50, alternative = 'all')
# lower tail ifr_os_t_test(hsb, write, mu = 50, alternative = 'less') # upper tail ifr_os_t_test(hsb, write, mu = 50, alternative = 'greater') # both tails ifr_os_t_test(hsb, write, mu = 50, alternative = 'both') # all tails ifr_os_t_test(hsb, write, mu = 50, alternative = 'all')
ifr_os_var_test
performs tests on the equality of standard
deviations (variances).It tests that the standard deviation of a sample is
equal to a hypothesized value.
ifr_os_var_test( data, x, sd, confint = 0.95, alternative = c("both", "less", "greater", "all"), ... )
ifr_os_var_test( data, x, sd, confint = 0.95, alternative = c("both", "less", "greater", "all"), ... )
data |
a |
x |
numeric; column in |
sd |
hypothesised standard deviation |
confint |
confidence level |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter |
... |
additional arguments passed to or from other methods |
ifr_os_var_test
returns an object of class "ifr_os_var_test"
.
An object of class "ifr_os_var_test"
is a list containing the
following components:
n |
number of observations |
sd |
hypothesised standard deviation of |
sigma |
observed standard deviation |
se |
estimated standard error |
chi |
chi-square statistic |
df |
degrees of freedom |
p_lower |
lower one-sided p-value |
p_upper |
upper one-sided p-value |
p_two |
two-sided p-value |
xbar |
mean of |
c_lwr |
lower confidence limit of standard deviation |
c_upr |
upper confidence limit of standard deviation |
var_name |
name of |
conf |
confidence level |
type |
alternative hypothesis |
infer_os_var_test()
has been deprecated. Instead use ifr_os_var_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_os_var_test(mtcars, mpg, 5, alternative = 'less') # upper tail ifr_os_var_test(mtcars, mpg, 5, alternative = 'greater') # both tails ifr_os_var_test(mtcars, mpg, 5, alternative = 'both') # all tails ifr_os_var_test(mtcars, mpg, 5, alternative = 'all')
# lower tail ifr_os_var_test(mtcars, mpg, 5, alternative = 'less') # upper tail ifr_os_var_test(mtcars, mpg, 5, alternative = 'greater') # both tails ifr_os_var_test(mtcars, mpg, 5, alternative = 'both') # all tails ifr_os_var_test(mtcars, mpg, 5, alternative = 'all')
runtest tests whether the observations of x
are serially
independent i.e. whether they occur in a random order, by counting
how many runs there are above and below a threshold. By default, the median
is used as the threshold. A small number of runs indicates positive serial
correlation; a large number indicates negative serial correlation.
ifr_runs_test( data, x, drop = FALSE, split = FALSE, mean = FALSE, threshold = NA )
ifr_runs_test( data, x, drop = FALSE, split = FALSE, mean = FALSE, threshold = NA )
data |
a |
x |
numeric; column in |
drop |
logical; if TRUE, values equal to the threshold will be dropped
from |
split |
logical; if TRUE, data will be recoded in binary format |
mean |
logical; if TRUE, mean will be used as threshold |
threshold |
threshold to be used for counting runs, specify 0 if data is coded as a binary. |
infer_runs_test
returns an object of class "ifr_runs_test"
.
An object of class "ifr_runs_test"
is a list containing the
following components:
n |
number of observations |
threshold |
within group sum of squares |
n_below |
number below the threshold |
n_above |
number above the threshold |
mean |
expected number of runs |
var |
variance of the number of runs |
n_runs |
number of runs |
z |
z statistic |
p |
p-value of |
runs_test()
has been deprecated. Instead use ifr_runs_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
Edgington, E. S. 1961. Probability table for number of runs of signs of first differences in ordered series. Journal of the American Statistical Association 56: 156–159.
Madansky, A. 1988. Prescriptions for Working Statisticians. New York: Springer.
Swed, F. S., and C. Eisenhart. 1943. Tables for testing randomness of grouping in a sequence of alternatives. Annals of Mathematical Statistics 14: 66–87.
ifr_runs_test(hsb, read) ifr_runs_test(hsb, read, drop = TRUE) ifr_runs_test(hsb, read, split = TRUE) ifr_runs_test(hsb, read, mean = TRUE) ifr_runs_test(hsb, read, threshold = 0)
ifr_runs_test(hsb, read) ifr_runs_test(hsb, read, drop = TRUE) ifr_runs_test(hsb, read, split = TRUE) ifr_runs_test(hsb, read, mean = TRUE) ifr_runs_test(hsb, read, threshold = 0)
ifr_ts_ind_ttest
compares the means of two independent groups in order to determine whether
there is statistical evidence that the associated population means are significantly different.
ifr_ts_ind_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all"), ... )
ifr_ts_ind_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all"), ... )
data |
a data frame |
x |
factor; a column in |
y |
numeric; a column in |
confint |
confidence level |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter |
... |
additional arguments passed to or from other methods |
ifr_ts_ind_ttest
returns an object of class "ifr_ts_ind_ttest"
.
An object of class "ifr_ts_ind_ttest"
is a list containing the
following components:
levels |
levels of |
obs |
number of observations of |
n |
total number of observations |
mean |
mean of |
sd |
standard deviation of |
se |
estimate of standard error of |
lower |
lower limit for the mean of |
upper |
upper limit for the mean of |
combined |
a data frame; mean, standard deviation, standard error and
confidence limit of mean of |
mean_diff |
difference in mean of |
se_dif |
estimate of the standard error for difference in mean of
|
sd_dif |
degrees of freedom |
conf_diff |
confidence interval for |
df_pooled |
degrees of freedom for the pooled method |
df_satterthwaite |
degrees of freedom for the Satterthwaite method |
t_pooled |
t statistic for the pooled method |
t_satterthwaite |
t statistic for the Satterthwaite method |
sig_pooled |
two-sided p-value for the pooled method |
sig_pooled_l |
lower one-sided p-value for the pooled method |
sig_pooled_u |
upper one-sided p-value for the pooled method |
sig |
two-sided p-value for the Satterthwaite method |
sig_l |
lower one-sided p-value for the Satterthwaite method |
sig_u |
upper one-sided p-value for the Satterthwaite method |
num_df |
numerator degrees of freedom for folded f test |
den_df |
denominator degrees of freedom for folded f test |
f |
f value for the equality of variances test |
f_sig |
p-value for the folded f test |
var_y |
name of |
confint |
confidence level |
alternative |
alternative hypothesis |
infer_ts_ind_ttest()
has been deprecated. Instead use ifr_ts_ind_ttest()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'less') # upper tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'greater') # both tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'both') # all tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'all')
# lower tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'less') # upper tail ifr_ts_ind_ttest(hsb, female, write, alternative = 'greater') # both tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'both') # all tails ifr_ts_ind_ttest(hsb, female, write, alternative = 'all')
ifr_ts_paired_ttest
tests that two samples have the
same mean, assuming paired data.
ifr_ts_paired_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all") )
ifr_ts_paired_ttest( data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all") )
data |
a |
x |
numeric; column in |
y |
numeric; column in |
confint |
confidence level |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter. |
ifr_ts_paired_ttest
returns an object of class "ifr_ts_paired_ttest"
.
An object of class "ifr_ts_paired_ttest"
is a list containing the
following components:
Obs |
number of observations |
b |
mean, standard deviation and standard error of |
tstat |
t statistic |
p_lower |
lower one-sided p-value |
p_upper |
upper one-sided p-value |
p_two_tail |
two sided p-value |
corr |
Correlation of |
corsig |
p-value of correlation test |
conf_int1 |
confidence interval for mean of |
conf_int2 |
confidence interval for mean of |
conf_int_diff |
confidence interval for mean of difference of |
df |
degrees of freedom |
confint |
confidence level |
alternative |
alternative hypothesis |
var_names |
names of |
xy |
string used in printing results of the test |
infer_ts_paired_ttest()
has been deprecated. Instead use
ifr_ts_paired_ttest()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# lower tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'less') # upper tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'greater') # both tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'both') # all tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'all')
# lower tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'less') # upper tail ifr_ts_paired_ttest(hsb, read, write, alternative = 'greater') # both tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'both') # all tails ifr_ts_paired_ttest(hsb, read, write, alternative = 'all')
Tests on the equality of proportions using large-sample statistics. It tests that a sample has the same proportion within two independent groups or two samples have the same proportion.
ifr_ts_prop_test( data, var1, var2, alternative = c("both", "less", "greater", "all"), ... ) ifr_ts_prop_group( data, var, group, alternative = c("both", "less", "greater", "all") ) ifr_ts_prop_calc( n1, n2, p1, p2, alternative = c("both", "less", "greater", "all"), ... )
ifr_ts_prop_test( data, var1, var2, alternative = c("both", "less", "greater", "all"), ... ) ifr_ts_prop_group( data, var, group, alternative = c("both", "less", "greater", "all") ) ifr_ts_prop_calc( n1, n2, p1, p2, alternative = c("both", "less", "greater", "all"), ... )
data |
a |
var1 |
factor; column in |
var2 |
factor; column in |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter |
... |
additional arguments passed to or from other methods |
var |
factor; column in |
group |
factor; column in |
n1 |
sample 1 size |
n2 |
sample 2 size |
p1 |
sample 1 proportion |
p2 |
sample 2 proportion |
an object of class "ifr_ts_prop_test"
.
An object of class "ifr_ts_prop_test"
is a list containing the
following components:
n1 |
sample 1 size |
n2 |
sample 2 size |
phat1 |
sample 1 proportion |
phat2 |
sample 2 proportion |
z |
z statistic |
sig |
p-value for z statistic |
alt |
alternative hypothesis |
infer_ts_prop_test()
, infer_ts_prop_grp()
and infer_ts_prop_calc()
have
been deprecated. Instead use ifr_ts_prop_test()
,
ifr_ts_prop_group()
and ifr_ts_prop_calc()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# using variables # lower tail ifr_ts_prop_test(treatment, treatment1, treatment2, alternative = 'less') # using groups # lower tail ifr_ts_prop_group(treatment2, outcome, female, alternative = 'less') # using sample size and proportions # lower tail ifr_ts_prop_calc(n1 = 30, n2 = 25, p1 = 0.3, p2 = 0.5, alternative = 'less')
# using variables # lower tail ifr_ts_prop_test(treatment, treatment1, treatment2, alternative = 'less') # using groups # lower tail ifr_ts_prop_group(treatment2, outcome, female, alternative = 'less') # using sample size and proportions # lower tail ifr_ts_prop_calc(n1 = 30, n2 = 25, p1 = 0.3, p2 = 0.5, alternative = 'less')
ifr_ts_var_test
performs tests on the equality of standard
deviations (variances).
ifr_ts_var_test( data, ..., group_var = NULL, alternative = c("less", "greater", "all") )
ifr_ts_var_test( data, ..., group_var = NULL, alternative = c("less", "greater", "all") )
data |
a |
... |
numeric; column(s) in |
group_var |
factor; column in |
alternative |
a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter. |
ifr_ts_var_test
returns an object of class "ifr_ts_var_test"
.
An object of class "ifr_ts_var_test"
is a list containing the
following components:
f |
f statistic |
lower |
lower one-sided p-value |
upper |
upper one-sided p-value |
two_tail |
two-sided p-value |
vars |
variances for each level of the grouping variable |
avgs |
means for each level of the grouping variable |
sds |
standard deviations for each level of the grouping variable |
ses |
standard errors for each level of the grouping variable |
avg |
combined mean |
sd |
combined standard deviation |
se |
estimated combined standard error |
n1 |
numerator degrees of freedom |
n2 |
denominator degrees of freedom |
lens |
number of observations for each level of grouping variable |
len |
number of observations |
lev |
levels of the grouping variable |
type |
alternative hypothesis |
infer_ts_var_test()
has been deprecated. Instead use ifr_ts_var_test()
.
Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.
# using grouping variable ifr_ts_var_test(hsb, read, group_var = female, alternative = 'less') # using two variables ifr_ts_var_test(hsb, read, write, alternative = 'less')
# using grouping variable ifr_ts_var_test(hsb, read, group_var = female, alternative = 'less') # using two variables ifr_ts_var_test(hsb, read, write, alternative = 'less')
A dataset containing information about two treatments
treatment
treatment
A data frame with 50 rows and 2 variables:
result of treatment type 1
result of treatment type 2
A dataset containing information about treatment outcomes
treatment2
treatment2
A data frame with 200 rows and 2 variables:
outcome of treatment
gender of patient, 0 for male and 1 for female