0% found this document useful (0 votes)
3 views42 pages

Understanding Correlation and Regression

1. The document addresses concepts of joint probability, covariance, correlation, and regression. 2. The general objectives are to understand joint probability, distinguish hypothesis tests and their significance, and perceive regression and correlation in various tests. 3. The specific objectives include understanding concepts such as joint probability, covariance, correlation, hypothesis testing, linear regression, and contingency tables.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views42 pages

Understanding Correlation and Regression

1. The document addresses concepts of joint probability, covariance, correlation, and regression. 2. The general objectives are to understand joint probability, distinguish hypothesis tests and their significance, and perceive regression and correlation in various tests. 3. The specific objectives include understanding concepts such as joint probability, covariance, correlation, hypothesis testing, linear regression, and contingency tables.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1 Introduction

General Objectives

2 Objectives specifics

3 PROBABILITY JOINT............................................................4

Co-variance and correlation coefficient.........................................................4

Co-variance

3.1 CORRELATION

Comparison between Pearson and Spearman coefficients..............................................7

Sensitivity of the Pearson correlation coefficient to outliers...............................8

3.2 Comparison between correlation and covariance..........................................................9

Correlation and relationships that change direction...............................................9

Correlation is not causation.

4 Coefficient of correlation

5 Distribution conditional.............................................................................................11

6 Distribution normal bivariate....................................................................................12

7 TEST THE HYPOTHESIS..............................................................................................16

8 Types of Hypotheses.....................................................................................................17

9 O level of significance..............................................................................................18

10 Significance test.............................................................................................19

11 TEST FOR THE MEAN OF A POPULATION.............................................20

12 Significance test for equality of two means............................................21

13 REGRESSION AND CORRELATION.........................................22

14 Dispersion of points..............................................................................................23

15 Correlation Coefficient.......................................................................................25

16 Simple Linear Regression.......................................................................................26


17 Multiple Regressions..............................................................................................27

18 Chi-square distribution

19 Kolmogorov-Smirnov Test..............................................................................32

20 Distribution Test (Smirnov)............................................................33

21 One-tailed test........................................................................................................34

22 Chi-square test in contingency table........................................................35

23 2 x 2 contingency table (comparison of two proportions)...........................36

24 Restrictions on the use of the chi-square test 2


)...........................................................3

25 Bibliography or bibliographic reference..........................................................6


Introduction
In carrying out this work, we will address joint probability, its concepts, its
distribution function, covariance and correlation coefficient; the hypothesis test and
significance within this theme we will address the main concepts, the types of errors,
and its stages, significance testing, and in the topic of regression and correlation we will address
about the correlation coefficient, scatter plots, types of regression, and their
respective tests.
General objectives
1. Discover what joint probability is, distinguish hypothesis tests with their significance and
understand regression and correlation in various tests

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,

DISCRETE RANDOM VARIATIONS

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.

Covariance and Correlation Coefficient

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 product moment correlation

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.

Spearman's rank correlation

Also called Spearman's rho, Spearman's correlation assesses the relationship


monotonic relationship between two continuous or ordinal variables. In a monotonic relationship, the

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.

Spearman's correlation is widely used to assess relationships involving variables.


ordinals. For example, you could use Spearman's correlation to assess whether the
the order in which employees perform a test is related to the number of months
of employment.

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.

Comparison between Pearson and Spearman coefficients


The Pearson and Spearman correlation coefficients can vary between -1 and +1. For the
Pearson's correlation coefficient is +1, when one variable increases, the others do too.
variables increase by a consistent amount. This relationship forms a line
perfect. The Spearman correlation coefficient is also +1 in this case.

+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.

Pearson = -0,093, Spearman = -0,093


If the relationship is a perfect line for a decreasing relationship, then the two coefficients of

correlation is -1.

Pearson = -1, Spearman = -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.

Pearson = -0,799, Spearman = -1

Correlation values of -1 or 1 imply an exact linear relationship, such as that between


radius and circumference of a circle. However, the real value of the correlation values is
in quantifying relationships that are not perfect. Finding the two variables that
are often correlated informs a regression analysis that tries to describe
but this type of relationship.

Sensitivity of Pearson's correlation coefficient to outliers

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:

Correlation coefficients are standardized. Therefore, a perfect linear relationship results in


in a coefficient 1.

The covariance values are not standardized. Thus, the value for a linear relationship
ideal depends on the data.

The correlation coefficient is a function of covariance. The correlation coefficient is


equal to the covariance divided by the product of the standard deviations of the variables. Therefore, a

Positive covariance always results in a positive correlation and negative covariance.


it always results in a negative correlation.

Correlation and relationships that change direction

Pearson correlation coefficients only measure linear relationships. The coefficients


Spearman's correlation only measures monotonic relationships. Therefore, it is possible that
there is a significant relationship even if the correlation coefficients are 0. Examine
um graph of dispersion for to determine a shape yes relationship.

Coefficient 0

This graph shows a very strong relationship. The Pearson coefficient and the coefficient of
Spearman is approximately 0.

Correlation is not causation

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:

Measure of the linear association between two variables (intensity)

The signal indicates whether the relationship between two variables is positive or negative (direction).

It is dimensionless

• X,Y independent =⇒ rXY = 0 (the opposite does not necessarily hold)

• −1 ≤ rXY ≤ 1 • It can be strongly influenced by "outliers".

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

forecast, as it quantitatively describes this relationship.

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 )

Similarly, the conditional distribution of Y given X = x is defined as:

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

there is an asymptotic distribution N(0,1) (that is, it approaches N(0,1) as n →∞).


From this theorem, we can derive the following result: • If X is the mean of a sample
random of size n, drawn from a population with mean µ and variance σ2, then
1 −q
f(x1,x2)= exp( )

2πσ1σ2 1−ρ 2 2
where μ1, μ2, σ1, σ2, and ρ are constants

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→∞

It is uniform with respect to x ∈ (−∞,+ ∞)

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 density of the distribution k2 = p1 + p2 is determined by the formula

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

For large values of (n)

(according to Sevastianov B.A., Chistiakov, Zubkov)

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

It is a hypothesis regarding the value of a population parameter, or regarding the


nature of the distribution of a population variable.

Examples of statistical hypotheses:

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

It is a decision rule to accept or reject a statistical hypothesis based on the


sampling elements.

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

Decision True value of μ False

μ=270s( It's green.) μ<270s( Aéverd.)

Do not reject H0 Correct decision 1 -α Error II (β ¿

Reject H0 Error I(α ) Correct decision (1-β)

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.

The level of significance


The maximum probability that a hypothesis test can make a Type I error is
significance level test call. This probability is often denoted
α
Usually, it is fixed before sample removal, so that the results obtained do not
influence the election.

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

to make mistakes with a probability of 0.05.


Basic stages in a hypothesis test

Hypothesis testing is among the most powerful and dangerous tools in


statistics. They allow us to make statements about a population and assign a degree
of uncertainty to these statements.

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.

presenting a statistical result, often described with a level of significance.


Considering that the subjects of these reports - public health, the environment, and so on
in front of - they are important for our lives, it is crucial that we appropriately carry out calculations

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.

Formulation or specification, simply put, represents the list of steps that


you should follow when building a hypothesis test. The steps of the hypothesis test are:

1. State the null hypothesis and the alternative hypothesis;


2. Select the appropriate distribution;
3. Determine the rejection region and the non-rejection region.
4. Once these steps have been completed, all you need to do is
calculate the p-value or the test statistic in order to complete the hypothesis test. It is
It is important to remain vigilant regarding the inherent traps of specification.

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...

The procedure for conducting significance tests is summarized in the following

step:

State the null hypothesis H0;

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;

5o) conclude the acceptance or rejection of H0 by comparing the calculated value in 4o


step with RA and RR.

TEST FOR THE MEAN OF A POPULATION


(a) known σ

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.

The hypotheses are:

H0: µ = µ0 against

H1: µ = µ1 or then, what is more common:

H1: µ > µ0 or µ < µ0 or µ ≠ µ0


The statistic test used here is the sample mean: X. This mean is to be compared
with the set price, determined based on the probability of Type I error, (that is, the
the significance level of the test) must first be standardized. This is done based on
in the following result:

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:

Z = (X - X mean) / X standard deviation = (X - mean) / standard deviation n

Assuming a significance level of α = P(Type I Error), it is verified in the table


what is the value of zα (in a one-tailed test) or zα/2 (in a two-tailed test). H0 (null hypothesis) is rejected.
if the value of z calculated in the above expression is:

Greater than zα (in the right-tailed test);

less than -zα (in the left-tailed test) and

Greater than zα/2 or less than -zα/2 (in the two-tailed test).

Significance test for equality of two means


1 case) If the population variances σ2 are known and presumed to be equal,
independent and normal, the test variable will be "Z" (n+ n¿30) 1 + 2 > ;

1. State the hypotheses:


H0: µ1 = µ2 or µ1 - µ2 = d

where d is the accepted difference between the two means.

2. Fix α. Choosing the standard normal variable 'Z';

3. With the help of the "Z" table, determine the regions RA and RR;

4. Calculate the value of the variable:

( X1−X2 )−d

√ s12σ22
n1n2
+

REGRESSION AND CORRELATION


Definitions

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.

Positive correlation: when there is a clustering of points in an upward trend, it means


as one variable increases, the other variable also increases. For example, in the case of
the relationship between temperature and the number of ice creams sold shows a positive correlation.

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 to use a Scatter Plot?


The Scatter Diagram is used to analyze the relationship between two variables and in which
the intensity of the change of one data impacts another data. This can be applied:

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.

When testing autocorrelation before creating a control chart.

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.

Coefficient of correlation and determination

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

Coefficient of determination of Regression

SQDreg
r 2= 0 2
SQDtot ≤≤r1

Simple linear regression


The linear regression analysis results in a mathematical regression that describes the
relationship between two variables. Linear Regression is used to estimate the value of
a variable based on known values of another. It assumes some causal relationship and
effect, of explaining the behavior between the variables. E.g. the age and weight of each calf;
the tax rate and revenue; price and quantity.

Simple Linear Regression


Casual relationship between two variables, and can be described by a straight line; One variable

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.

Least squares line

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

multiple is addressed with two or more explanatory variables

If we estimate a variable z from variables x and y through a regression equation


form z=a+bx+cy. demonstrate that the equation of multiple regression of least squares is
obtain a, b, c.

If the points (x1,y1,z1),...(xn,yn,zn), meet the values of z on the regression plane of


The least squares corresponding to (x1,y1),...(xn,yn) are respectively.

a + bx1 + cy1, ..., a + bxn + cyn,

therefore the deviations of z1,...,zn are given by ∑ d 2= ∑


¿¿¿

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.

Since (1) represents a plane in a three-dimensional rectangular coordinate system if


often refers to plan and regression. to find the least squares regression plan.
we determine (a,b,c) in (1) so that

∑ 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

Let Y be a continuous random variable with a chi-squared distribution.


( 2
) comrgraus de

freedom. Graphically, the distribution 2


can be represented by:

f(Y)

p P(Y > yc) = p


O
Y
y c = χ c2

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.

Chi-square as a goodness of fit test


The term adherence refers to the comparison of experimental frequency data with the
theoretical distribution.
Example 2. In rats, blood group Ag-B is associated with a locus with several alleles.
(multiple alleles), whose segregation, in certain crosses between lineages, seems to present
significant deviations from Mendelian ratios. The results (progeny) of the cross between
the lineages (heterozygous) of Ag-B mice1Ag-B4x Ag-B1Ag-B4were:

Genotypes (k) f0 fesob H0*


Ag-B1Ag-B1 58 50 foobserved frequency
Ag-B1Ag-B4 129 100
Ag-B4Ag-B4 13 50
Total (n) 200 200
* H0the segregation follows the Mendelian ratio 1 : 2 : 1

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 =

100 and 200.1/4 = 50.

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

what about H0has distribution 2


(chi-square) comr = k - 1 degrees of freedom.
Note that in er, 1 is subtracted from k due to the restriction condition that establishes that, being
the remaining can be determined
by difference.
When the feThey can only be calculated through estimates of parameters.
population-based on sample statistics, the number of degrees of freedom (r) is given by
= k – 1 – m.

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. Fix significance level

2
3. Calculate obs

2 (58 50)2(129 100)2(13 50)2


o bs   1.28 8.41 27.38 37.07
50 100 50
4. Determine the critical region

2 2
RC { c ( , k 1 ) }

2
as k -1 = 2 and if = 1% c= 9.21

5. Establish the decision rule

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

more explanatory variables.

The data consists of a set of n elements, which form a random sample.


X1, X2, ..., Xn associated with some distribution function, F(x). Let F∗(x) a distribution function
completely specified. It is possible to formulate the following hypotheses:

Bilateral test

H0 : F(x)=F∗(x) for all x∈R

H1 : F(x) = F∗(x) at least for a value of x

B. Unilateral test

H0 : F*(x) ≥ G(x) for all

H1 : F(x) <F∗(x) at least for a value of x

C. Unilateral test

H0 : F(x) ≤ F∗(x) for all x∈R

H1 : F(x) > F∗(x) at least for a value of x

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'.

Distribution Test (Smirnov)


The bilateral Smirnov test is consistent with respect to all types of differences that may arise.
to arise between the two distribution functions. And a version of the Kormogorov test, valid for
two samples, also known as the Kolmogorov-Smirnov test for two
samples. The Kormogorov test is also known as the Kormogorov - Smirnov test for
a sample.

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.

We can formulate the following hypotheses:

Bilateral test

H0: F(x)=G(x) for all X ∈R

H1: F(x)≠ G (x) at least for a value of x

Unilateral test
H0: F(x)< = G (x)for all X ∈R

(The values of X tend to be lower than those of Y)

F(x) ¿ G(x) at least for a value of X

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 )

F(x) ¿ G(x)at least for a value of X.

The 'statistic' is defined differently depending on the set of hypotheses.


considered.

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.

random of sizes equal to n. The empirical distributions are, respectively,


S1(x), S2(x), ..., Sk(x), and the distribution functions F1(x), F2(x), ..., Fk(x) represent the k
populations, unknown, The random samples must be independent of each other.

others. The variables must be continuous for the test to be accurate. Otherwise, it becomes
conservative.

The scale of measurements is at least ordinal.

H0: F(x) ≥ G(x) for all x∈R

The hypothesis states that the values of X are shifted to the right (higher) compared to those of

H1: F(x) < G(x) at least for one value of x


The 'statistic' is defined differently depending on the set of hypotheses.
considered.

3 Chi-square test in contingency table


The classification of observations (in general, of qualitative variables) according to two criteria
is referred to as a contingency table.

Example 4. Nature of cows, according to breed and type of mating

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

as table x n. In the example, the table is 3 x 2.

Contingency tables are constructed for the purpose of testing:

(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)

Example 5. Considering the following table:

Treatment Death Survival Total


A 41 (53,86) 216 (203.14) 257
B 64 (51,14) 180 (192,86) 244
Total 105 396 501

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.

fe(= (105.257)/501 = 53,86

and the others by difference (values in parentheses in the table)

gl = (2 - 1) . (2 - 1) = 1

2 (41 53.86 2 (180 1 92.86 2


o bs  ... 7.97
53.86 192.86

2
c (1%;1) 6.63
2 2
How obs c , H is rejected0that is, there is a real difference between the proportions of

mortality (or survival) caused by treatments A and B.

For 2 x 2 contingency tables, the value of 2


it can also be obtained by formula (1):

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

In 2 x 2 contingency tables, some authors recommend using the test of 2


with correction
from Yates' correction. This correction consists of subtracting ½ from each difference (fo– fe) before
to square it. With this procedure, formula (1) transforms into:

N
(c.b A.D. ) 2.N
2 2
obs
1 .n2.n3 .n4

With Yates' correction, the value of 2


in Example 5 it becomes 7.37, showing that in
large samples produce practically the same result as the 2
not corrected. The correction
it is important especially when the values of fethey are small, but if the smallest fefor
< 5, one should then use Fisher's exact test, which is based exclusively on the calculation of
probabilities. We will not address this test, however.

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

In other words, farmingthe probability of an individual, selected at random, belonging


to the cell of row i of column j, [Link] probability of belonging to the line (total marginal) ep.j,
the probability of belonging to the column (marginal total), we have that the probabilities in the body
from the table (pij) will be the products of the marginal totals (pij= pi.. p.j), if the criteria are
independents.

In the case of example 5, if events A and M, corresponding to treatment A and occurrence


of death, respectively, are independent,
257 105
0.1075
P(A M) = P(A).P(M) = 501 501 Thus, in the cell of the 1st row and 1st column, the

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

H0the two attributes are independent


H1the two attributes are not independent

2 (96 99)2(59 56)2 (7 8)2


obs    5.2
99 56 8

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%.

Restrictions on the use of the chi-square test 2


)
For theoretical reasons:
The tests seen are applied without restriction if all expected frequencies are greater than
what 5;
when the degree of freedom is equal to 1, each expected frequency should not be less than 5;
when the degree of freedom is greater than 1, the chi-square test should not be used if more
if 20% of the expected frequencies are less than 5 or if any expected frequency is
less than 1.
tests should only be applied to observed data and never with proportions or
percentages originating from the same.

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

During the execution of this work, it was noticed that

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.

4. Projorov YU.V., Rozanov Yu.A. Theory of probabilities. (main concepts, theorems of


limit, random processes)

Mathematical Statistics

Introduction to Statistics
Scientific Ed. [10] P.G. HOEL. Introduction to Mathematical Statistics. John Wiley and Sons.

You might also like