Using a parameter {statistic, test} can test {test, statistics} {statistical tests} whether two sample groups from population are similar.
statistic
Statistic can be mean or variance.
hypothesis
Hypothesis is false if it leads to contradiction, and then hypothesis opposite is true. Assume groups have no difference for statistic {null hypothesis, statistical test}. Try to reject null hypothesis.
significance
Choose allowable probability {significance level, test}, usually 5%, that rejected hypothesis is actually true {type-one error, test} or that accepted hypothesis is actually false {type-two error, test}.
calculation
Calculate probability that sample group is from population.
comparison
Reject hypothesis if probability is less than 5%. The statistic {two-tailed test, error} can be too high and/or too low, the usual case. The statistic {one-tailed test} can be too low or too high. It is hard to prove hypotheses true, but hypotheses are false if they lead to contradiction, thus proving hypothesis opposite.
Statistics can test statement {hypothesis, statement} about population {hypothesis testing}.
To test, take sample. Sample can be from hypothesized population or not. Sample can be represent hypothesized population or not. If sample is from hypothesized population and represents it, hypothesis is true. If sample is not from hypothesized population and does not represent it, hypothesis is false.
errors
If sample is from hypothesized population but does not represent it, hypothesis is true but seems false. Errors {Type I error} can happen, with probability {alpha risk}.
If sample is not from hypothesized population and represents it, hypothesis is false but seems true. Errors {Type II error} can happen, with probability {beta risk}.
independence
Perhaps, events, such as political party, job type, sex, or age category, do not affect each other {independence, statistics}. Tests can see if they do affect each other {dependence, statistics}.
Testing variable found in mutually exclusive groups from same population, normally distributed or not, can show if groups are equivalent {analysis of variance} {variance analysis} (ANOVA).
measurements
In ANOVA, measurements are sums of four parts: mean, class or treatment effect, sampling or measurement effect, and normally distributed random error. ANOVA checks if sampling error or class error is great enough compared to random error to make samples or classes actually different.
process
Assume groups are equivalent and so have same mean. Set significance level to 5%.
For two groups, calculate variance ratio {variance ratio} {F value, ANOVA}. Group degrees of freedom are group number minus one: C - 1. Sample degrees of freedom df are sum of group degrees of freedom Ni, minus group number C. df = N1 + N2 + ... - C.
Numerator is sample-mean-difference variance: ( (sum from i = 1 to i = N1 of (n1(i))^2) / N1 - (sum from i = 1 to i = N1 + N2 + ... of (n(i))^2) / (N1 + N2 + ...) ) / (C - 1) + ( (sum from i = 1 to i = N2 of (n2(i))^2) / N2 - (sum from i = 1 to i = N1 + N2 + ... of (n(i))^2) / (N1 + N2 + ...) ) / (C - 1) + ... Denominator is population variance: ( (sum from i = 1 to i = N1 + N2 + ... of (n(i))^2) - ( (sum from i = 1 to i = N1 of (n1(i))^2) / N1 + (sum from i = 1 to i = N2 of (n2(i))^2) / N2 + ... ) ) / (N1 + N2 + ... - C), where n is frequency, N is sample size, and C is sample number.
F values form distributions {F distribution, ANOVA} that vary with degrees of freedom and significance.
If calculated F value is less than F value in F distribution for same degrees of freedom and significance level, accept that samples have same mean. If calculated F value is more, reject hypothesis, so at least one sample is not random, or samples are from different populations.
mean square
For samples or treatments, degrees of freedom can divide into sum of squares of differences between values and mean {mean square}. Mean square estimates population variance. F value is sample or treatment mean square divided by error mean square.
missing data
Least-squares method can estimate missing data.
types
Replications are like classes {randomized blocks plan}.
Testing interactions between treatments can be at same time as testing interactions between samples {two-way classification}.
comparison to t test
With two samples, F test and t test are similar.
In populations, tests {chi square} can show whether one property, such as treatments, affects another property, such as recovery level. Properties have mutually exclusive outcomes, such as cured or not.
process
Hypothesize that events are independent. Select significance level, typically 5%. Make contingency table.
Calculate degrees of freedom: (R - 1) * (C - 1), where R is number of table rows and C is number of table columns.
Calculate chi square value: X = sum from i = 1 to i = R and from j = 1 to j = C of (x(i,j) - f(i,j))^2 / f(i,j), where x(i,j) is observed frequency and f(i,j) is expected frequency. f(i,j) = (sum from i = 1 to i = R of x(i,j)) * (sum from j = 1 to j = C of x(i,j)) / (sum from i = 1 to i = R and from j = 1 to j = C of x(i,j)), where x(i,j) is observed frequency.
result
If calculated chi square value is less than actual chi square value for degrees of freedom at significance level, do not reject hypothesis.
Table rows can be possible outcomes of one variable, and table columns can be possible outcomes of other variable {contingency table}. Table cells are numbers {observed frequency} having both outcomes. For example, table rows can be Wide and Narrow people, and table columns can be Tall and Short people, so table 0 1 / 2 3 has 0 of Wide and Tall and 3 of Narrow and Short.
Testing two same-size samples, each from different and not necessarily normally distributed populations, can show if populations are the same {F test}. Hypothesize that samples are the same. Set significance level to 5%. Sample degrees of freedom are sample size minus one. Calculate variance ratios between two samples {F distribution, test} {F value, test}: v1 / v2, where v is sample variance. If calculated F value is less than actual F value for degrees of freedom at significance level, do not reject hypothesis. F distribution measures variance distribution.
Experiments {factorial experiment} can use factors. Several variables {factor, variable} can affect dependent variable. Set up ANOVA. Calculate factor effects, by finding average of differences between variable measurements, while holding other factors at their constant means. Calculate factor interactions, by finding differences between variable-measurement changes, at varying other-variable levels. Small differences mean little interaction. For no interactions, factor effects can add.
ANOVA {nested classification} {hierarchical classification} can have sample treatments and classes.
Randomizing treatments over replications {Latin square} can control two variation sources.
ANOVA {mixed model ANOVA} can have no treatments or classes, with sample subsamples.
ANOVA {fixed effect model} {Model I analysis of variance} can have no treatments or classes and only replicate samples.
ANOVA {random effect model} {Model II analysis of variance} can have one random sample from any number of treatments or classes.
Tests {distribution-free test} {non-parametric test}, such as sign tests, can be for unknown distributions. Sign and difference value can make a non-parametric test {sign rank test}.
Assume groups have no difference for parameter {null hypothesis, test}|.
Methods {sequential analysis} can test paired attribute data to decide between classes/treatments. For all pairs, check treatment differences. Count only significant differences. Observe until number of accepted counted differences exceeds number required by significance level and total number of observations, or until total number of observations exceeds threshold. If difference number is greater than threshold, accept that one treatment is better.
Testing two samples with matched pairs {sign test} can show if they are from same, not necessarily normally distributed, population.
matched pairs
Before and after comparison has matched pairs.
hypothesis
Hypothesize that first and second samples show no change.
significance
Set significance level to 5%.
degrees of freedom
Degrees of freedom are sample size minus one.
calculation
For all matched pairs, subtract before-value from after-value to get plus, minus, or no sign. Add positive signs.
Use probability of 1/2 for getting positive sign, because samples are the same by hypothesis. Calculate binomial-distribution z score: (P - 0) / (N * 0.5 * 0.5)^0.5, where P is positive-sign number, N is sample size, mean equals zero, and standard deviation equals (N * p * (1 - p))^0.5.
test
If z score is less than normal-distribution value with same degrees of freedom at significance level, do not reject hypothesis.
Choose allowable probability {significance level, statistics}|, usually 5%, that rejected hypothesis is actually true {type-one error, significance} or that accepted hypothesis is actually false {type-two error, significance}.
Sample can test the hypothetical mean of normally distributed population {t test} {one-sample t test}. Hypothesize that sample and population means are equal. Set significance level to 5%. Sample size less one gives independent-value number {degrees of freedom, t test}. Calculate distribution of same-size-sample means with same degrees of freedom. Result is similar to normal distribution, except distribution includes degrees of freedom {t value} {t distribution}: t = (x - u)/e, where x is sample mean, u is hypothetical population mean, and e is sample-mean standard error. If calculated t value is less than actual t value for significance level and degrees of freedom, do not reject hypothesis.
two samples
Testing two independent samples from population can show if samples are from same population. Hypothesize that first and second sample means are equal. Set significance level to 5%. Degrees of freedom involve both sample sizes: (N1 - 1) + (N2 - 1) = N1 + N2 - 2. Calculate t value: t = (x1 - x2)/e, where x is sample mean. e is standard error of difference, which equals ( ( (v1 * (N1 - 1) + v2 * (N2 - 1)) / (N1 + N2 - 2) )^0.5) * ((1 / N1 + 1 / N2)^0.5), where v is sample variance and N is sample degrees of freedom. If t value is less than t-distribution value with same degrees of freedom at significance level, do not reject hypothesis.
paired samples
Testing two paired samples, or matched pair samples, can show if they are from same population. Hypothesize that first and second sample means are equal. Set significance level to 5%. Degrees of freedom are sample size minus one. Calculate t value: t = sum from i = 1 to i = N of (n1 - n2)/e, where N is sample size and n is sample value. e is standard error of difference, which equals (N * (sum from i = 1 to i = N of (n1 - n2)^2) - (sum from i = 1 to i = N of (n1 - n2)^2) ) / (N - 1)^0.5. If t value is less than t-distribution value with same degrees of freedom at significance level, do not reject hypothesis.
Statistic can be too high and/or too low {two-tailed test, statistics}, the usual case.
Rejected hypothesis can be actually true {type-one error, statistics}.
Accepted hypothesis can be actually false {type-two error, statistics}.
Testing {z test} an outcome that recurs in successive events can show if it is a true outcome.
set up
Assume outcome is true outcome. Set significance level to 5%. Degrees of freedom are sample size minus one. Add number of times outcome happens. Use probability, usually 0.5, suggested by null hypothesis for outcome.
test
Calculate z score for binomial distribution: (P - 0) / (N * p * (1 - p))^0.5, where P is outcome number, p is probability, N is event number, mean equals zero, and standard deviation equals (N * p * (1 - p))^0.5. If z score is less than normal-distribution value with same degrees of freedom at significance level, do not reject hypothesis.
Outline of Knowledge Database Home Page
Description of Outline of Knowledge Database
Date Modified: 2022.0225