Understanding Correlation and Regression
Understanding Correlation and Regression
General Objectives
2 Objectives specifics
3 PROBABILITY JOINT............................................................4
Co-variance
3.1 CORRELATION
4 Coefficient of correlation
5 Distribution conditional.............................................................................................11
8 Types of Hypotheses.....................................................................................................17
9 O level of significance..............................................................................................18
10 Significance test.............................................................................................19
14 Dispersion of points..............................................................................................23
15 Correlation Coefficient.......................................................................................25
18 Chi-square distribution
19 Kolmogorov-Smirnov Test..............................................................................32
21 One-tailed test........................................................................................................34
Specific objectives
1. Understand the concept of joint probability, distribution function, covariance and
correlation coefficient.
2. understand the main concepts of hypothesis testing and significance and distinguish the types of
errors, and their basic steps in a hypothesis test;
3. concept of Regression and correlation, their scatter diagrams, the types of tests and their
contingency tables
Methodology
In carrying out this work, the following resources were used: the internet, the review.
bibliographic
Joint Probability
Distribution function
Our study of random variables and their probability functions has so far been restricted
the one-dimensional sample spaces in which the observed values were assumed by a
unique v. a. However, there are situations where one wishes to observe simultaneous results of
several random variables. For example, we can measure the total precipitation, the humidity, and the
temperature, result in a three-dimensional sample space consisting of the results (p, u,
If x and y are two random variables, the probability distribution of their occurrence
simultaneous can be represented by the function with values f(x, y) for any pair of values (x,
It is customary to refer to this function as the Joint Probability Distribution of x and y. For
the discrete case: F(x, y) – P (X = x, Y = y) = f.m.p. that is, the values f(x, y) give the probability
for results x and y to occur at the same time.
Co-variance
Covariance measures the linear relationship between two variables. Covariance is not standardized,
unlike the correlation coefficient. Therefore, covariance values can vary from
negative infinity to positive infinity. Positive covariance values indicate that values
Above the average of one variable is associated with average values above the other variable.
and below the average values are also associated. Negative covariance values
indicate that values above the average of a variable are associated with average values
below the other variable. thus it can be written:
CORRELATION
A correlation coefficient measures the degree to which two variables tend to change together.
The coefficient describes the strength and direction of the relationship. Minitab offers two correlation analyses.
different
Pearson's correlation assesses the linear relationship between two continuous variables. One
a relationship is linear when the change in one variable is associated with a change
proportional in the other variable.
For example, you could use a Pearson correlation to evaluate whether increases in
the installation production temperatures are associated with a reduction in thickness of
chocolate coating.
variables tend to change together but not necessarily at a constant rate. The
Spearman's correlation coefficient is based on the ranked values of each.
variable, instead of the raw data.
It is always a good idea to examine the relationship between variables with a scatter plot. The
correlation coefficients measure only linear relationships (Pearson) or
monotonic (Spearman). Other relationships are possible.
+1
If the relationship is that one variable increases when the other increases but the quantity is not
consistent, the Pearson correlation coefficient is positive but less than +1. The
the Spearman coefficient will still be +1 in this case.
+0.851
When a relationship is random or nonexistent, both correlation coefficients will
approach zero.
correlation is -1.
If the relationship is that variable that decreases when the others increase, but the
the quantity is not consistent, so the Pearson correlation coefficient is negative, but
greater than -1. The Spearman coefficient will still be -1 in this case.
A unique extreme value can significantly affect the Pearson coefficient. Look for it.
for discrepant values and consider their effect. If you know that an outlier is
associated with abnormal and one-time events (also known as causes
special), you can calculate the Pearson coefficient without the outlier. Then compare the
new value for the Pearson coefficient with the outlier. If the values are quite
different, the analysis results may be invalid.
Comparison between correlation and covariance
Although the coefficient of correlation and covariance are measures of linear association, they
they differ in the following aspects:
The covariance values are not standardized. Thus, the value for a linear relationship
ideal depends on the data.
Coefficient 0
This graph shows a very strong relationship. The Pearson coefficient and the coefficient of
Spearman is approximately 0.
It is important to know that correlation does not imply causation. Only controlled experiments
Because properties allow us to determine if the relationship is causal. A well-known example of this
the concept states that ice cream sales are positively correlated with attacks of
shark to bathers. It would be a mistake to conclude that ice cream consumption is causing attacks.
of shark. The most mundane explanation is that the heat increases ice cream sales and the
sea bath.
Correlation coefficient
The covariance, however, does not provide a measure of the intensity of the relationship, since
it depends on the units in which the variables are expressed. One way to work around this
the problem is through data standardization, subtracting from each xi and yi, for i = 1,...,n
its respective mean and dividing by the corresponding sample standard deviation. We have the
following standardized variables:
1
eleven−x n
ui= formulas r= n
sxsy ∑
Sx ( eleven−x)(One−Y)
i=1
where ¯ X and ¯ Y are the averages of the values of X and Y respectively and sX and sY the
standard deviations of the same variables. The numerator of the expression is the average of the products
the deviations of X and Y, in relation to the corresponding means. The denominator is the product
the standard deviations of X and Y. Interpretation of r:
The correlation coefficient r measures the association between two variables; it is positive when the
association is positive and negative when the association is negative (the value of r is much greater)
the stronger the association;
2. the coefficient of correlation always takes values between -1 and +1 (the standard deviations in
the denominator standardizes r, the units in the numerator and denominator are the same, the
what it means that r is dimensionless); 3. the extreme values r = -1 and r = 1 indicate a
perfect association (r =−1 means that the points belong to a straight line with slope
negative, that is, when x increases, y decreases; r = 1 means that the points belong to a
straight line with positive slope, that is, when x increases, y also increases;
4. The correlation coefficient measures the closeness of the scatter of points in relation to a
straight line (r measures a linear association)
Properties:
The signal indicates whether the relationship between two variables is positive or negative (direction).
It is dimensionless
Although the correlation coefficient is quite useful in measuring the strength and direction of the relationship
linear between two variables, cannot be used for prediction (what is the value of Y, for a
determined value of X?). Furthermore, the correlation coefficient only assesses the relationship between
pairs of variables. Regression analysis, which we will see next, can be seen as
an interesting extension of correlation analysis because it does not limit the evaluation of the relationship to
pairs of variables and allows the construction of a model that, in addition to measuring intensity and
the direction of the relationship between the response and explanatory variables can also be used for
1 Conditional Distribution
Let (X, Y) be a discrete random vector with joint distribution p(x, y). The distribution
P ( X =x = y ) For all x
The conditional of X given Y = y is defined as: P(X = x | Y = y) =
(Y = y )
P( X=x,Y= y)
P(Y= y∨X =x)=
P( X=x )
Bivariate normal distribution
In some experiments, it is necessary to consider the properties of 2 or more variables.
simultaneously. The joint probability distribution of two random variables is called a
bivariate distribution.
Normal Distribution
Definition We say that a random variable X has a Normal (or Gaussian) distribution with
mean µ and variance σ2 (−∞ < µ < ∞ and σ > 0) if X has a continuous distribution with
f.d.p. given by:
The bivariate normal distribution is a two-dimensional normal distribution of the random variables X1 and
X2. It is a generalization of the normal distribution for a random variable X. The probability density function is given by f(x)=
−1(x− μ)
1 2
for −∞ < x < ∞
e
∂√2π
To explore as much as possible the information provided by the 'statistics' of the sample is
It is essential to know the distributions of these 'statistics'. We will then study the three.
most important sampling distributions in experimental planning. In many
statistical processes assume that the random variable follows a normal distribution. This is justified by
application of the following theorem:
Theorem 4 (Central Limit Theorem): If X1, X2, ..., Xn form a sequence of n random variables.
independent, with means and variances respectively equal to µi and σ2 i, i = 1, 2, ..., n and if
we will build another v.a. U,
U = X1 + X2 + ... + Xn,
Formula
1 2 ρ ( x 1 −μ 1 )(x 2 −μ 2 )
q= - +¿
¿¿ σ1σ2
the parameterρ is the correlation coefficient of X1 and X2 and can be calculated from
E [( x1−μ 1 ) ( x2−μ 2 ) ]
ρ=
σ1σ2
is a random variable whose probability density function approaches N(0,1) as n tends to infinity
for ∞. The quantity Z is a 'statistic'. We constantly resort to the use of
‘statistics’ in the analysis of experiences. They allow us to draw conclusions about
populations based on information extracted from samples (representative of the populations).
They are used in what we call Inferential Statistics.
The Moivre-Laplace theorem follows the number of favorable cases kn and n trials of
Bernoulli has a distribution close to normal.. we represent Kn in the form of a sum and
independent indicators kn=p1+p2+p3,….,,+pn, where pk+1 is the x-th test =0 if it is
unfavorable.
The Moivre-Laplace theorem can be stated as follows: if the variables p1, p2, p3, ...
...pn, are independent B(pk=1)=1-B(pk=0)=p,k=1,2,... then n→∞
The statement (1) has been valid for sufficiently general assumptions about the law of
distribution of the random variables pk, let us determine the distribution density of
sum of kn=p1+p2+p3+…+pn, where n=1,2,3, pk(k=1,2,3), are random variables
independent and uniformly distributed in the segment (-1,1). Thus, the densities
Rk(x)=p(x)(k=1,2,3), where
The distribution density of the sum of three random variables can be determined by
the distribution density of the sum of variables k3=k2+p3
Once the intervals for which the sub-integral functions are positive are determined and
After making the calculations, similar to those of reality, to realize we sum up, we obtain
Theorem: if p1, p2, .., pn, .. are independent random variables that have moments.
absolute finite, we do
A.M)
HYPOTHESIS TEST
It is a technique for making statistical inference. That is, based on a test of
hypotheses, made with sample data, one can infer about the population.
In the case of inference through Confidence Interval, the goal is to 'fence in' the parameter.
unknown population. Here a hypothesis is formulated regarding the value of the parameter
population, and by the sample elements a test is conducted that will indicate the ACCEPTANCE or
REJECTION of the formulated hypothesis.
Main Concepts
Statistical Hypothesis
a) The average height of the Brazilian population is 1.65 m, that is: H: µ = 1.65 m; b) The variance
the population of salaries is $5002, that is, H: σ2 = 5002; c) The proportion of people from São Paulo
smokers is 25%, that is, H: p = 0.25 d) The distribution of the weights of the students in our
college is normal.
Hypothesis Test
Types of Hypotheses
The hypothesis to be tested is designated as Ho, called the null hypothesis, and by H1 the
alternative hypothesis. The null hypothesis expresses an equality, while the hypothesis
an alternative is given by an inequality (≠ , < , >).
Types of errors
There are two types of errors when testing a statistical hypothesis. One can reject a hypothesis
when it is, in fact, true, or to accept a hypothesis when it is, in fact, false. A
the rejection of a true hypothesis is called 'type I error'. The acceptance of a hypothesis
false constitutes a "Type II error."
The probabilities of these two types of errors are designated, respectively, by α and β.
The probability α of a Type I error is called the 'significance level' of the test.
The possible errors and correct answers of a test are summarized below.
Reality
Note that a type I error can only occur if Ho is rejected and a type II error when it is not.
I accept Ho.
In practice, it is common to use significance levels of 0.05 or 0.01, but they can also be
other values were used. If, for example, a significance level of June 6 is 05
selected to design a hypothesis test, then there are about 5 times 100 in which to reject, when
it should be accepted, that is, the hypothesis is that there is a 95% confidence that the correct decision is made. In this
In this case, it is said that the hypothesis was rejected at the significance level of 0.5, which means that you can
Pick up a newspaper and flip through it; it will be rare for a day that the newspaper does not contain a piece of news.
statisticians and interpretations. The first step, the one you should look for when you are
reading the statistical results, it is the appropriate specification/formulation.
Although it may seem obvious, properly declaring the hypotheses can be difficult. For
hypotheses regarding the arithmetic mean of a population, the null hypothesis and the hypothesis
Alternatives are mathematical statements that do not overlap and also do not present
lacunas.
Significance test
Significance tests only consider type α errors, as they are the most commonly used in
educational research, socio-economic...
step:
2o) set the error limit α, and identify the test variable;
3o) with the help of the statistical tables, considering α and the test variable, determine the
RR (rejection region) and RA (acceptance region) for Ho;
4o) with the sample elements, calculate the value of the test variable;
The test for the mean of a population can be performed with any size of
sample if we know that the population from which the sample is drawn follows a
normal distribution. If the population distribution is not known, then it is necessary
work with large samples (at least 30 elements) to ensure
normality of the sample mean through the central limit theorem.
H0: µ = µ0 against
If X is a normal random variable with mean µ and standard deviation σ, then the variable:
Z = (X - µ) / σ
There is a normal distribution with a mean of '0' and a standard deviation of '1'. The resulting variable Z
is tabulated. Any statistics book provides this table that gives the values.
from this variable, for z varying from -3.9 to 3.9 in intervals of 0.1 (decimal approximation),
between -3.9 and -3.0 and between 3.0 and 3.9, and in intervals of 0.01 (hundredths approximation) for the
values between -3.0 and 3.0.
For X, it is known that X µ = µ (mean of the means) and X σ = σ n (standard error of the mean), then
the standardized value of X will be:
Greater than zα/2 or less than -zα/2 (in the two-tailed test).
3. With the help of the "Z" table, determine the regions RA and RR;
( X1−X2 )−d
√ s12σ22
n1n2
+
It is the relationship between two or more quantitative variables: a dependent variable, whose value
should be provided and one (or more) independent or explanatory variable(s) about
in which there is theoretical knowledge available. Estimating an equation is
geometrically equivalent to fitting a curve to dispersed data = REGRESSION.
When two variables (X and Y) are linked by a statistical relationship, we say that there exists
correlation between them. This technique is used, specifically, to assess the degree
of the covariance between two random variables.
Scatter diagram
Considered one of the 7 basic quality tools, the Scatter Diagram, also
known as Scatter Plot, Correlation Graph, or XY Graph, it is a
graphic representation of the possible relationship between two variables, that is, it shows in a way
graph the pairs of numerical data and their relationship.
Generally, the relationship comes from one variable that is independent and another variable that is dependent.
from the first, that is, the independent variable is the cause that produces the effect and the dependent is the
effect, the consequence generated by the cause, therefore, if we were to analyze the relationship between the
ambient temperature with the number of ice creams sold in a scatter plot,
we will see that the higher the temperature, the more ice creams are sold. In this case, the variable
independent is the temperature and the dependent is the quantity of ice creams sold.
You can also use the Scatter Diagram to validate whether a certain variable
independent analyzed has a real impact on a certain dependent variable.
This relationship between the variables is called correlation, and there are three types: positive, negative, and
zero.
Negative correlation: when the points concentrate in a line that decreases, it means that
as one variable increases, the other variable decreases, that is, the higher the occurrence
the lower one of the data, the less the occurrence of the other data. For example, if we correlate the
birth rate with the wealth of a country, we will see that the richer a country, the lower the
birth rate.
Zero correlation: when there is a large dispersion among the points or they do not follow a trend.
neither positive nor negative, means that there is no apparent correlation between the variables.
Dispersion of points
The dispersion of the points shows the intensity of the relationship: strong or weak.
The smaller the dispersion of the points, the greater the correlation between the data.
Weak: The greater the dispersion of the points, the lower the degree between the data.
When trying to identify possible root causes of the problems, that is, instead of raising only
assumptions, perform a validation with a scatter plot to list hypotheses of causes
root based on facts and data.
After brainstorming causes and effects using a Fishbone Diagram, for example, to
determine if a cause and an effect are related. imagine discussing the causes of
the number of accidents on a highway, appeared as a cause the 'rainy day', then it is possible
make a scatter plot of the relationship between rainy days and the number of accidents.
In validation, whether 2 effects occur from the same cause. This is very useful when
you have several non-conformities with the same root cause and you want to validate if the
the correlation is true.
What can happen is that even if the scatter plot shows a relationship, it does not
suppose that one variable caused the other. Both may be influenced by a third
variable that was not considered, therefore, when using this tool it is necessary to gather
hypothesis constant.
For example: statisticians reached the hypothesis that the higher the consumption of ice creams in
beach, more people drowned. A bit nonsensical. But when people take more
ice creams? Usually on hot days, and the hotter it is, the more people tend to go to the
sea floor, a logical explanation of correlation for the case of deaths on the beaches of Santos.
Therefore, the death factor and ice cream sales factor are related to temperature.
How to do it?
1. Select the cause and the effect for which you want to discover the relationship.
2. Collect the data from these two variables to compose the graphs. This collection of
data can be done through the checklist;
3. Draw the two axes of the graph, placing the dependent variable on the vertical axis, and the
independent variable on the horizontal axis.
4. Place the data on the graph, drawing a point for each occurrence of the
data;
5. Check the arrangement of the points on the graph to identify if there is a positive correlation.
negative or null.
Correlation Coefficient
It is said that there is a correlation between two or more variables when the changes experienced by one
they are accompanied by changes in the others. That is, in the case of two variables x and y the
increases (or decreases) in x correspond to increases (or decreases) in y. Thus, the
correlation reveals whether there is a functional relationship between a variable and the others. Note that the
the word regression in Statistics corresponds to the word function in Mathematics. That is, while
The mathematician says that y is a function of x, the statistician talks about the regression of y on x.
It is a value that informs the intensity and the form of the linear correlation between two variables.
based on the analysis of the result we can determine whether the use of is appropriate or not
linear model for modeling the phenomenon.
Mathematical Model
n . ∑ x y − ( Σx ) .(⅀ Y )
R=
√ ⦋n . ∑ x 2−( x )2⦌ . ⦋ n ⅀ y 2−(∑y)2
SQDreg
r 2= 0 2
SQDtot ≤≤r1
dependent call, and another independent call. It also has the objective
determine the equation of the fitted line (linear mathematical model).
Casual relationship with more than two variables. That is, when the behavior of Y is
explained by more than one independent variable X1, X2, ....Xn. It is the appropriate technique for
to be used when one wants to simultaneously investigate the effects on Y of 2 or more
predictor variables.
Using the definition above, we can show that the least squares line approximation to
data set (x1, y1), ..., (xn, yn) has the equation y=ax+ b
Where the constants a and b are determined at the same time by solving the equations
∑ y=a+b ∑x
(4)∑ xy=ax+b
∑ ∑x2
The values of a and b obtained from (4) are given by
a= ∑
y∑ ∑x 2− ∑ x xy
n ∑ x 2−¿ ¿
b=
∑ y− ∑
x ∑ xy
n ∑ x −¿ ¿
2
The sample variances and covariances of x and y are given by the following equations.
, sxy= ∑
( x −x)( y− y)
sx= ¿∑ ∑
2 2
¿¿ ,
translatedText= ¿¿¿ ,
n
Or we can write by
y− y x−x x−x y− y
=r ( ) , =r ( )
sy sx sx sy
Multiple Regressions
Multiple regression is a collection of statistical techniques for building models that
they reasonably describe relationships between several explanatory variables of a
determined process. The difference between simple linear regression and multiple regression is that in
The previous ideas can also generalize if more variables are added. For example, if we want to
that a linear relationship between a dependent variable z and y to independent variables x and y then
we will look for an equation connecting the variables that has the form Z=a+bx+cy.
This is called the regression equation of z on x, y. If x is a dependent variable.
a similar equation would be called a regression equation on y,z.
∑ z =na+b ∑ x +c∑ y
∑ xz=a ∑ ∑
x+ b x∑
2
+c xy
∑ xz=a ∑ ∑
y +b ∑
xy+c y2
These equations called normal equations corresponding to (1) are obtained as a result.
to apply a similar definition. Generalization to more variables including linear and non-linear equations
linear conduits to the regression surface in three-dimensional spaces and higher.
2 Chi-square Distribution
f(Y)
Just like in the case of the Student's t distribution, there is a family of distributions. 2
indexed
2
by the number (integer) of degrees of freedom. Table 6 provides the values of
yc c for
some values dep( ) and degrees of freedom. For example,
r p = 0.05
1
.
.
2
c 15,507
8.
Degrees of freedom (df) is defined as the number of independent values of a
statistics, in the case of 2
, as will be shown ahead.
Chi-square tests
Tests that use the chi-square distribution as a structure will be presented here.
probabilistic and for this reason they are called chi-square tests. The figure above presents the
model density 2
with the critical region (CR) of the test, that is,
RC Y χ 2 }.
These tests are used for discrete (categorical) data from a population,
such as mortality or pathological findings, etc. The chi-square value is an estimator of
discrepancy between expected and observed frequencies, establishing whether the differences
whether or not they are due to chance.
which, at first glance, differ from the Mendelian ratio of 1:2:1. Formulating hypothesis H0of what
the segregation is 1 : 2 : 1, the feThe three genotypes are, respectively, 200.1/4 = 50, 200.2/4 =
To test if the observed numbers (foOf the three genotypes, two are consistent with the expected ones.
(feBased on the segregation 1:2:1, then the statistic is used:
2
k (f 0 f e) 2
i 1 fe
2 2 2
,r ,r
Formally, fixed H is rejected0himself , where denotes the point for which a
variable Y, distributed as 2
with r degrees of freedom, satisfies P(Y > yc) = .
It is important to note that H is only rejected.0as the observed frequency moves away from the
expected, that is, when the values obtained for the 2
they were big.
Test procedure:
1. State H0e H1
The
0 segregation is consistent with Mendelian reasoning 1:2:1
The
1 segregation is different from 1:2:1
2
3. Calculate obs
2 2
RC { c ( , k 1 ) }
2
as k -1 = 2 and if = 1% c= 9.21
2 2
Reject H0himselfo c
6. Conclude
2 2
How obs c H is rejected0(the hypothesis that the results are in accordance with the reason
mendelian 1 : 2 : 1.
Kolmogorov-Smirnov Test
Multiple regression is a collection of statistical techniques for building models that describe
In a reasonable manner, relationships between various explanatory variables of a certain process.
the difference between simple linear regression and multiple regression is that in multiple regression two or more are addressed
Bilateral test
B. Unilateral test
C. Unilateral test
The test is conservative if F∗(x) for discrete. The Kolmogorov test should be used instead of the
chi-square test, when the sample is small, as it is accurate even for small samples.
samples, whereas, the Chi-square tests assume a reasonable number of observations,
so that the χ2 distribution is a good approximation to the distribution of the 'statistic' Q.
The Kolmogorov test should be used when the distribution function of the null hypothesis is
completely specified, that is, when there are no parameters that need to be estimated.
to depart from the sample. Otherwise, it becomes conservative. More flexible than this is the test of
chi-square adjustment. In this latter case, we had the opportunity to estimate some parameters of the
distribution, unknowns, based on the data (sample). Consequently, to the number of
degrees of freedom of the 'statistic' of the test, one unit was subtracted for each parameter
dear. The Chi-square test also requires a 'grouping' of the data, which sometimes is
arbitrary. The Kolmogorov test was modified to allow situations where the
parameters are estimated from the data. The 'statistic' of the test is of the same type
(Kolmogorov) and what varies are the critical points of the distribution table of the 'statistic'.
The data consist of two independent random samples, one of size n, X1, X2,..., Xn
and another of size m, Y1, Y2,…Ym taken from two populations with distribution F(x) and G(y)
(or G(x)) respectively. These functions are unknown. It aims to know if the two
functions are identical.
The Smirnov test is exact if the distributions are continuous. If they are discrete, the test is
still valid although it becomes conservative.
Bilateral test
Unilateral test
H0: F(x)< = G (x)for all X ∈R
Unilateral test
H0: F(x)≥ G (x) for all X belongs to real numbers
The hypothesis states that the values of X are shifted to the right (higher) in relation to the
of Y )
A Smirnov type test for the case of 3 distributions is the Birnbaum - Hall test, analogous to
Smirnov test. If the differences between the means are accompanied by differences between the
variances, among others, Smirnov-type tests are more powerful than Kruskal-Wallis tests
it's normal. The only drawback of the Birnbaum-Hall test lies in the fact that it can only be applied to
three distributions, since the critical points of the test 'statistic' distribution were
calculated and tabulated only for this case. For this reason, there are other tests, still of the type
Smirnov, whose distributions were constructed (tabulated) for more (up to 10) distributions. These
tests are not consistent with all possible alternative hypotheses, as will be seen. The test
Smirnov's unilateral test is suitable for alternative hypotheses that consider the differences and the
directions in which they arise. They are therefore unilateral alternatives. The data consists of k samples.
others. The variables must be continuous for the test to be accurate. Otherwise, it becomes
conservative.
The hypothesis states that the values of X are shifted to the right (higher) compared to those of
Type of mating
Race Fecund Non-fecund Total
Charolesa 110 (120) 50 (40) 160
Gir 70 (60) 10 (20) 80
Nelore 30 (30) 10 (10) 40
Total 210 70 280
If one criterion involves categories (rows) and the other involves categories (columns), the table is referred to
(1) the relationship of dependence (association) between two variables (Test of independence). The test
of independence is based on the sampling scheme, in which a single random sample of
classified with respect to two characteristics simultaneously;
that the various columns (or rows) have the same proportion of individuals in the various categories
of a characteristic, if the totals of the rows (or columns) are specified in advance
Homogeneity test.
4 Contingency table 2 x 2 (comparison of two proportions)
check if the data provide evidence that the mortality rates are different
for both treatments ( = 1%).
Solution:
H0: pA= pB
H1: pA pB
in that: pAe pBthey denote the mortality (or survival) proportions for treatments A and
B, respectively.
gl = (2 - 1) . (2 - 1) = 1
2
c (1%;1) 6.63
2 2
How obs c , H is rejected0that is, there is a real difference between the proportions of
Total
a b n1
c d n2
Total n3n4N
2 (c.b a.d)2 .N
obs
n 1 .n2 .n3 .n4 (1)
2 (216.64 41.1802.501(13.824 7.380)2.501
obs
So, (257).(244).(105).(396) 2,607,398,640 = 7.97
N
(c.b A.D. ) 2.N
2 2
obs
1 .n2.n3 .n4
pˆ A p Bˆ
Z
pˆ ( 1 p)(1/
ˆ n A) (1/ nB )
Note. It can be shown through algebraic calculation that Z2 é
exactly the same as 2
for a 2 x 2 contingency table. This is the case of Example 5,
2
where: Z2 2
7.97. Furthermore, (Z0.005= 2,575)2= 6.63 is the critical point of 2
( c) , with =
1% e gl = 1. Thus, these two tests are equivalent for comparing two proportions.
Meanwhile, if the test is monocausal, as is the case with H1: p12the test 2
it is not
appropriate.
Independence test
The procedure for the independence test is equivalent to that presented for the test of
homogeneity, that is, the formulas for 2
the degrees of freedom are the same for both the
homogeneity test as for independence. Only the sampling method and the
formalization of H0they are different for the two situations.
For a general treatment of the independence test in an r x c contingency table,
suppose n individuals classified according to two criteria: A and B, and that there are r categories
for A (A1, A2, ..., Ar) and categories for B (B1, B2, ..., Bc). Placing category A in the rows and
In the columns, one can build a double-entry table, in which each cell is the intersection.
from A with B.
The null hypothesis of interest to test is that the classifications A and B are independent.
Remembering that the probability of the intersection of independent events is the product of their
probabilities, hence the null hypothesis of independence, stating that events A1, A2, ...,
Arare independent of events B1, B2, ..., B,
c can be represented by : P(AiBj) =
P(AiIn other words, in a contingency table of rows and columns, the null hypothesis of
independence is:
i 1,2, ,
H0: pij= pi.. p.j for everyone
j 1,2, , c
257.105
expected number is 0,1075.501 = 53.86 501 , just like in the homogeneity test.
Continuing in this way or by difference, one obtains the other expected numbers.
Example 6. Test of independence between the attributes sex and blood group, considering a
sample of 367 individuals, classified according to both characteristics simultaneously.
Blood group
Sex O A B AB Total
Male 96(99) 94(98) 30(24) 14(13) 234
Female 59(56) 60(56) 7(13) 7(8) 133
Total 155 154 37 21 367
2
c (5%, 3) 7.82
2 2
obs< c (5%, 3)the hypothesis of independence between the two attributes (gender and
Conclusion: how
blood group) is not rejected at the significance level of 5%.
Note: if there are restrictions on the use of the test, one may eventually combine adjacent categories of
way to increase the expected frequencies.
Final considerations
Our study of random variables and their probability functions so far has been restricted
to unidimensional sample spaces in which the observed values were assumed by a
The basic steps of hypothesis testing are:
Declare the null hypothesis
Significance only considers type I errors (α), as they are the most used in research.
educational, socio-economic. It is a technique for making statistical inference. Or
thus, based on a hypothesis test conducted with the sample data, one can infer about the
population. It is said that there is a correlation between two or more variables when the changes
sufferings from one of them are accompanied by modifications in the others. The maximum probability
that testing a hypothesis can lead to a type I error is called a level test
significance of the test. The Lilliefors test, a modification of the Kolmogorov-Smirnov test,
uses the Kolmogorov-Smirnov D statistic that measures the maximum absolute difference between the
empirical and theoretical cumulative distribution function, Multiple regression is a collection of
statistical techniques to build models that reasonably describe relationships between
several explanatory variables of a certain process, Using the above definition, we can
show that the least squares line approximates the dataset (x1, y1), ..., (xn, yn)
there is the equation y=ax+b
Bibliography or bibliographic reference
Sevastianov B.A., Chistiakov V.P., Zubkov A.M. problems of theory of
probabilities .editor Mir Moscow,1982.
2. Smirnov N.V., Dunin-Barkovski I.V. Manual of Probability Theory and Statistics
математика для технического применения
3. Borovkov A.A. Theory of Probability, in Russian.
Mathematical Statistics
Introduction to Statistics
Scientific Ed. [10] P.G. HOEL. Introduction to Mathematical Statistics. John Wiley and Sons.