Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4....

46
Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II 1 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva [email protected]

Transcript of Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4....

Page 1: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Métodos Quantitativos

Unidade 4. Estatística inferencial – Parte II

1 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 2: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Sumário

2

Seção Slides

4.1 – Correlação entre variáveis quantitativas 03 – 11

4.2 – Teste de significância 12 – 19

4.3 – Regressão linear 20 – 27

4.4 – Estudando resíduos 28 – 43

Anexo A – Alfabeto grego 44 – 46

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 3: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

CORRELAÇÃO ENTRE VARIÁVEIS QUANTITATIVAS

Seção 4.1

3 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 4: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Correlação

• Duas variáveis estão correlacionadas quando existe uma relação de dependência entre elas

4 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 5: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Covariância

𝐶𝑜𝑣 𝑋, 𝑌 = 𝑥𝑖 − 𝑥 ∗ (𝑦𝑖 − 𝑦 )

𝑛 − 1, 𝑐𝑜𝑚 𝑛 ≥ 2

• Correlação entre as variáveis:

– Se Cov (X,Y) > 0 ... correlação positiva

– Se Cov (X,Y) < 0 ... correlação negativa

– Se Cov (X,Y) = 0 ... não existe correlação

5 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 6: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Covariância e relação das variáveis

• Com covariância tradicional podemos pensar que quanto maior a magnitude da covariância, maior o relacionamento entre as variáveis.

• Isso não é verdade, dado que quanto maior o valor dos dados maior a chance disto ocorrer.

• Para corrigir tal situação, uma possibilidade é utilizar variáveis padronizadas.

• Para corrigir esta questão (padronizar variáveis) utilizar o coeficiente de correlação.

6 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 7: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Coeficiente de correlação

𝑟 = 𝜌 𝑋, 𝑌 =

𝑥𝑖 − 𝑥 ∗ (𝑦𝑖 − 𝑦 )𝑛 − 1

𝑑𝑝 𝑥 ∗ 𝑑𝑝(𝑦)=

𝐶𝑜𝑣(𝑋, 𝑌)

𝑑𝑝(𝑥) × 𝑑𝑝(𝑦)

– Se r > 0 ... variáveis são positivamente correlacionadas

– Se r < 0 ... variáveis são negativamente correlacionadas

– Se r = 0 ... variáveis não são correlacionadas

– Se r = +1 ... correlação positiva perfeita

– Se r = -1 ... correlação negativa perfeita

Observação: Quanto mais próxima de +1 (relação direta) ou -1 (relação inversa), mais forte é a correlação 7

Page 8: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Forma alternativa de calcular

• Mais prática do que as formulas anteriores.

• Usar a soma dos quadrados das variáveis.

8

𝑆𝑄 𝑥𝑦 = 𝑥𝑦 −( 𝑥)( 𝑦)

𝑛

𝑟 = 𝜌 𝑋, 𝑌 = 𝑆𝑄 (𝑥𝑦)

𝑆𝑄 𝑥 𝑥 𝑆𝑄(𝑦)

𝑆𝑄 𝑥 = 𝑥2 −( 𝑥)

2

𝑛

𝑆𝑄 𝑦 = 𝑦2 −( 𝑦)

2

𝑛

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 9: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1

• Usando a SQ(xy) calcular o coeficiente de correlação para as variáveis apresentadas na tabela abaixo e classifique as variáveis quanto à correlação

9

Ano PIB (X) Investimentos em educação (Y)

1950 20 2

1951 22 2

1952 23 3

1953 25 5

1954 26 6

1955 26 8

1956 28 9

Dad

os

hip

oté

tico

s

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 10: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - resolução Ano (n) 𝑋 𝑌 𝑋2 𝑌2 𝑋𝑌

1950 (1) 20 2 400 4 40

1951 (2) 22 2 484 4 44

1952 (3) 23 3 529 9 69

1953 (4) 25 5 625 25 125

1954 (5) 26 6 676 36 156

1955 (6) 26 8 676 64 208

1956 (7) 28 9 784 81 252

170 35 4.174 223 894

𝑆𝑄 𝑥 = 4174 −170 2

7= 45,43

𝑆𝑄 𝑦 = 223 −35 2

7= 48

𝑆𝑄 𝑥𝑦 = 894 −170 ∗ 35

7= 44

𝑟 = 𝑝 𝑋, 𝑌 =44

45,43 ∗ 48= 0,94

X e Y são positivamente correlacionadas (correlação forte). 10

Page 11: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exercício 1

• Usando a SQ(xy) calcular o coeficiente de correlação para as variáveis apresentadas na tabela abaixo e classifique as variáveis quanto à correlação

Ano Consumo (X) Preço (Y)

1950 1 10

1951 2 9

1952 3 8

1953 4 7

1954 5 6

1955 6 5

1956 7 4

Dad

os

hip

oté

tico

s

Resposta: r=-1 ; X e Y apresentam correlação negativa (perfeita) 11

Page 12: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

TESTE DE SIGNIFICÂNCIA

Seção 4.2

12 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 13: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Coeficiente de correlação (𝑟)

13

• Se 𝑟 > 0 ... Correlação positiva entre X e Y – Quanto mais próximo de 1, mais forte a correlação

• Se 𝑟 < 0 ... Correlação negativa entre X e Y – Quanto mais próximo de -1, mais forte a correlação

• Se 𝑟 = 0 ... Não há correlação entre X e Y

• Se 𝑟 ≅ 0 ... Indício de não correlação

• Tendo isto em mente, vamos fazer teste de hipótese para

checar a força de uma correlação por meio de 𝑟 (teste de significância)

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 14: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Teste de significância (hipóteses)

14

Hipóteses Lado

𝐻0: 𝜌 ≥ 0 (não há correlação negativa significativa) 𝐻1: 𝜌 < 0 (correlação negativa significativa)

Unilateral à esquerda

𝐻0: 𝜌 ≤ 0 (não há correlação positiva significativa) 𝐻1: 𝜌 > 0 (correlação positiva significativa)

Unilateral à direita

𝐻0: 𝜌 = 0 (não há correlação significativa) 𝐻1: 𝜌 ≠ 0 (correlação significativa)

Bilateral

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 15: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Fórmula para calcular hipóteses

• Teste 𝑡 pode ser usado

– Caso de correlação entre duas variáveis ser significativa

– Distribuição 𝑡 com 𝑛 − 2 graus de liberdade

𝑡𝑐 = 𝑟

𝜎𝑟=

𝑟

1 − 𝑟2

𝑛 − 2

15 diegofernandes.weebly.com

Prof. Me Diego Fernandes Emiliano Silva [email protected]

Page 16: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1

• Nos slides 09 e 10 foi apresentado um exemplo com relação a PIB e investimento, onde o 𝑟 = 0,9423. Com 95% de confiança, o valor de 𝑟 = 0,9423 indica que a correlação é significante?

16 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 17: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - resolução

• Passo 1: elaborar hipóteses Teoricamente, parece que quando investimento , o PIB 𝐻𝑜: 𝜌 = 0 ... Não há correlação significante 𝐻1: 𝜌 ≠ 0 ... Correlação significante

• Passo 2: Fixar nível de significância 𝛼 = 100% − 95% = 5%

• Passo 3: Calcular estatística

𝑡𝑐 =0,9423

1 − (0,9423)2

7 − 2

≅ 6,2940

17 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 18: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - resolução

• Passo 4: Tomar decisão Como teste é bilateral, devemos consultar a coluna 5% na tabela 𝑡 Pegando 𝑔𝑙 = 7 − 2, vamos na linha 5, e coluna 5%, e dessa forma, percebemos que 𝑡 = 2,571, ou seja, nossa região crítica é R𝐶 = {𝑇 ∈ ℝ|𝑇 ≤ −2,571 𝑜𝑢 𝑇 ≥2,571} Como 𝑡𝑐 = 6,2940 ∈ 𝑅𝐶, rejeitamos 𝐻0, ou seja, nossa correlação entre PIB e Investimento pode ser considerada significativa

18 diegofernandes.weebly.com

Prof. Me Diego Fernandes Emiliano Silva [email protected]

Page 19: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exercício 1: Obter o coeficiente de correlação entre o conjunto de dados da tabela abaixo e testar a significância de 𝑟 para 95% de confiança.

– Adotar: 𝑆𝑄 𝑋 = 0,4417; 𝑆𝑄 𝑌 = 8,6363 ; 𝑆𝑄 𝑋𝑌 =− 1,5172. (Resposta: 𝑡𝑐 = −2,75821).

Pessoa Índice de placa

bacteriana (X) Tempo de escovação

em minutos (Y)

1 0,08 2,50

2 0,18 1,20

3 0,78 0,50

4 0,03 2,80

5 0,20 1,18

6 0,00 4,00

7 0,05 2,50 19

Page 20: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

REGRESSÃO LINEAR

Seção 4.3

20 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 21: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Regressão linear

• Princípio básico: reta que melhor se ajusta a um conjunto de pontos (X,Y) observados

21 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 22: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Matematicamente

• De modo intuitivo, pensar numa função de grau 1: 𝑦 = 𝑎𝑥 + 𝑏, em que 𝑎 e 𝑏 são números desconhecidos, e para ser uma função de grau 1, 𝑎 ≠ 0.

• Regressão linear: Dada uma amostra de dados bivariados, vamos montar função: 𝑦 = 𝑎 𝑥 + 𝑏 – Como se trata de uma “reta média” entre os pontos

observados, é importante perceber que existe um erro entre cada valor da amostra e da reta.

22 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 23: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Calculando os coeficientes

𝑦 = 𝑎 𝑥 + 𝑏

𝑎 = 𝑟𝑠(𝑌)

𝑠(𝑋)

𝑏 = 𝑦 − 𝑎 . 𝑥

• Legenda:

𝑎 = coeficiente angular

𝑏 = intercepto

𝑟 = coeficiente de correlação

𝑠 = desvio-padrão amostral

𝑦 = média dos valores de Y

𝑥 = média dos valores de X

23 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 24: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Fórmulas alternativas

𝑦 = 𝑎 𝑥 + 𝑏

𝑎 =𝑛 𝑥𝑦 − ( 𝑥)( 𝑦)

𝑛 𝑥2 − ( 𝑥)2 =

𝑆𝑄(𝑥𝑦)

𝑆𝑄(𝑥)

𝑏 = 𝑦 − 𝑎 𝑥 = 𝑦

𝑛− 𝑎

𝑥

𝑛

24 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 25: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1

• Obter a regressão linear do conjunto de dados da tabela abaixo:

Pessoa Índice de placa bacteriana (X)

Tempo de escovação em minutos (Y)

1 0,08 2,50

2 0,18 1,20

3 0,78 0,50

4 0,03 2,80

5 0,20 1,18

6 0,00 4,00

7 0,05 2,50 25

Page 26: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – resolução n X Y X^2 Y^2 XY

1 0,08 2,50 0,0064 6,2500 0,2000

2 0,18 1,20 0,0324 1,4400 0,2160

3 0,78 0,50 0,6084 0,2500 0,3900

4 0,03 2,80 0,0009 7,8400 0,0840

5 0,20 1,18 0,0400 1,3924 0,2360

6 0,00 4,00 0,0000 16,0000 0,0000

7 0,05 2,50 0,6903 6,2500 0,1250

Soma 1,32 14,68 0,6906 39,4224 1,2510

Média 0,18857 2,09714

dp 0,27132 1,19975

26

Page 27: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – resolução

𝑆𝑄 𝑋 = 0,6906 −1,32 2

7

𝑆𝑄(𝑋) = 0,44169

𝑆𝑄 𝑌 = 39,4224 −14,68 2

7

𝑆𝑄(𝑌) = 8,63634

𝑆𝑄 𝑋𝑌 = 1,2510 −1,32 ∗ 14,68

7

𝑆𝑄(𝑋𝑌) = −1,51723

𝑎 =𝑆𝑄(𝑋𝑌)

𝑆𝑄(𝑋)=

−1,51723

0,44169

𝑎 = −3,43509

𝑏 = 𝑦 − 𝑎 . 𝑥 𝑏 = 2,09714 − (−3,43509)(0,18857)

𝑏 = 2,74490

𝑦 = 𝑎 𝑥 + 𝑏 𝑦 = −3,43509𝑥 + 2,74490

27 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 28: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

SEÇÃO 4.4

Estudando os resíduos

28 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 29: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Recapitulando - Exemplo 1

• Supondo dados da tabela,

𝒏 𝒙𝒊 𝒚𝒊 𝒙𝒊𝟐 𝒚𝒊

𝟐 𝒙𝒊. 𝒚𝒊

1 2 8 4 64 16

2 4 8,5 16 72,25 34

3 5 9 25 81 45

4 6 10 36 100 60

5 8 10,5 64 110,25 84

6 9 11 81 121 99

7 10 12 100 144 120

44 69 326 692,5 458

Média 6,28571 9,85714

29 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 30: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – coeficiente de correlação

• 𝑆𝑄 𝑥 = 326 −44 2

7= 49,42857

• 𝑆𝑄 𝑦 = 692,5 −69 2

7= 12,35714

• 𝑆𝑄 𝑥𝑦 = 458 −44∗69

7= 24,28571

• 𝑟 =24,28571

49,42857∗12,35714= 0,98266

30 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 31: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - 𝑟 significante (95%)

• 𝐻0: 𝜌 = 0 (não há correlação significante) • 𝐻1: 𝜌 ≠ 0 (há correlação significante)

• 𝑡𝑐 =𝑟

1−𝑟2

𝑛−2

=0,98266

1−(0,98266)2

7−2

= 11,85022

• 𝛼 = 100% − 95% = 5%

• 𝑅𝐶 = 𝑇 ∈ ℝ|𝑇 ≤ −2,571 𝑜𝑢 𝑇 ≥ 2,571 • Como 𝑡𝑐 ∈ 𝑅𝐶, rejeitamos 𝐻0, ou seja, existem indícios que

permitem considerar a correlação entre 𝑥𝑖 e 𝑦𝑖

31 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 32: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – regressão linear

• 𝑎 =𝑆𝑄(𝑥𝑦)

𝑆𝑄(𝑥)=

24,28571

49,42857

• 𝑎 = 0,49133

• 𝑏 = 𝑦 − 𝑎 ∗ 𝑥 = 9,85714 − 0,49133 ∗ 6,28571

• 𝑏 = 6,76878

• 𝑦 = 𝑎 𝑥 + 𝑏

• 𝑦 = 0,49133𝑥 + 6,76878

32 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 33: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Contexto

• Mesmo ajustando a regressão aos dados observados, ainda assim é comum que o ajuste esteja sujeito a erros, o qual chamamos de desvios

33 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 34: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Tipos de desvios

• Desvio não explicado: diferença entre valor amostrado e o valor previsto pela regressão (𝑒𝑖 = 𝑦𝑖 − 𝑦 𝑖) – Diferença entre valor previsto e o amostrado

• Desvio explicado: diferença entre o valor previsto pela regressão e o valor médio da mesma (𝑦 𝑖 − 𝑦 ) – Desvio totalmente entendido pela regressão

• Desvio total: diferença entre o valor amostrado e o valor médio (𝑦𝑖 − 𝑦 ) – Ou seja, desvio total = desvio explicado + desvio não explicado

34 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 35: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Fórmula dos desvios

𝑉𝑎𝑟𝑖𝑎çã𝑜 𝑡𝑜𝑡𝑎𝑙 = 𝑣𝑎𝑟. 𝑒𝑥𝑝𝑙𝑖𝑐𝑎𝑑𝑎 + 𝑣𝑎𝑟. 𝑛ã𝑜 𝑒𝑥𝑝𝑙𝑖𝑐𝑎𝑑𝑎

(𝑦𝑖 − 𝑦 )2 = (𝑦 𝑖 − 𝑦 )2 + 𝑦𝑖 − 𝑦 𝑖2

35 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 36: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - desvios

𝒏 𝒙𝒊 𝒚𝒊 Regressão DT DE DNE

1 2 8 7,75145 3,44898 4,43396 0,06178

2 4 8,5 8,73410 1,84184 1,26122 0,05480

3 5 9 9,22543 0,73469 0,39906 0,05082

4 6 10 9,71676 0,02041 0,01971 0,08022

5 8 10,5 10,69942 0,41327 0,70943 0,03977

6 9 11 11,19075 1,30612 1,77851 0,03639

7 10 12 11,68208 4,59184 3,33040 0,10107

69 - 12,3571 11,93229 0,42486

Média 9,85714 - - - -

Desvio total: 𝐷𝑇 = (𝑦𝑖 − 𝑦 )2 𝐷𝑇 = 𝐷𝐸 + 𝐷𝑁𝐸

Desvio explicado: 𝐷𝐸 = (𝑦 𝑖 − 𝑦 )2 Desvio não explicado: 𝐷𝑁𝐸 = 𝑦𝑖 − 𝑦 𝑖

2

36

Page 37: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Coeficiente de determinação (ou explicação)

• Medida que mostra em termos percentuais, quanto de Y e explicado por X. Por exemplo, se o resultado do coeficiente de determinação for 0,8: – Significa que 80% da variação de Y se deve a X

– Significa que 20% não pode ser explicado por X

𝐶𝑜𝑒𝑓𝑖𝑐𝑖𝑒𝑛𝑡𝑒 𝑑𝑒 𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎çã𝑜 = 𝑣𝑎𝑟𝑖𝑎çã𝑜 𝑒𝑥𝑝𝑙𝑖𝑐𝑎𝑑𝑎

𝑣𝑎𝑟𝑖𝑎çã𝑜 𝑡𝑜𝑡𝑎𝑙

𝐶𝑜𝑒𝑓𝑖𝑐𝑖𝑒𝑛𝑡𝑒 𝑑𝑒 𝑑𝑒𝑡𝑒𝑟𝑚𝑖𝑛𝑎çã𝑜 = 𝑟2

37 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 38: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – coeficiente de determinação (𝑟2)

𝑟2 = 𝑣𝑎𝑟𝑖𝑎çã𝑜 𝑒𝑥𝑝𝑙𝑖𝑐𝑎𝑑𝑎

𝑣𝑎𝑟𝑖𝑎çã𝑜 𝑡𝑜𝑡𝑎𝑙=

11,93229

12,35714= 0,96562

Ou

𝑟2 = 0,982662 = 0,96562

– Isso significa que 96,56% da variação de Y se deve a X

– E que 3,44% não pode ser explicado por X

38 diegofernandes.weebly.com

Prof. Me Diego Fernandes Emiliano Silva [email protected]

Page 39: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Intervalo de previsão (IP)

• Intervalo de previsão: quando fazemos uma regressão linear 𝑦 = 𝑎 𝑥 + 𝑏 , é natural se construir um intervalo de confiança para a estimativa

• Dada 𝑦 = 𝑎 𝑥 + 𝑏 , para cada valor específico 𝑥𝑖, o intervalo de confiança para 𝑦𝑖 será: 𝑦 𝑖 − 𝐸 < 𝑦𝑖 < 𝑦 𝑖 + 𝐸, ou, 𝑦 𝑖 − 𝐸, 𝑦 𝑖 −𝐸 , onde 𝐸 é a margem de erro.

39 diegofernandes.weebly.com

Prof. Me Diego Fernandes Emiliano Silva [email protected]

Page 40: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

IP

• Dada regressão 𝑦 = 𝑎 . 𝑥 + 𝑏 , margem de erro 𝐸 para estimativa 𝑦 0, calculada a partir de um valor 𝑥0, é dada por:

𝐸 = 𝑡𝛾 ∙ 𝑆𝑒 ∙ 1 +1

𝑛+

𝑛 𝑥0 − 𝑥 2

𝑛 𝑥2 − 𝑥 2

𝑡𝛾 é obtido a partir da tabela T com n-2 graus de liberdade e erro padrão da estimativa obtido pela fórmula:

𝑆𝑒 = (𝑦𝑖 − 𝑦 𝑖)

2

𝑛 − 2=

𝑦𝑖2 − 𝑏 𝑦𝑖 − 𝑎 𝑥𝑖𝑦𝑖

𝑛 − 2

40 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 41: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 - IP

𝑦 = 0,49133𝑥 + 6,76878 com 95% de confiança para 𝑦 0, dado 𝑥𝑜 = 4

Resolução: 𝑦 0 = 0,49133 ∗ 4 + 6,76879 = 8,73410

𝑆𝑒 = (𝑦𝑖 − 𝑦 𝑖)

2

𝑛 − 2=

0,42486

7 − 2= 0,29150

41 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 42: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – IP (continuação)

• 𝛼 = 100% − 95% = 5% ... 𝑡𝛾 = 2,571

• 𝐸 = 𝑡𝛾 ∙ 𝑆𝑒 ∙ 1 +1

𝑛+

𝑛 𝑥0−𝑥 2

𝑛 𝑥2− 𝑥 2

• 𝐸 = 2,571 ∙ 0,29150 ∙ 1 +1

7+

7(4−6,28571)2

7(326)−(44)2

• 𝐸 = 0,83742

42 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 43: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

Exemplo 1 – IP (continuação)

• 𝐼𝐶 𝑦 0 = 8,73410 ; 95%

• 𝐼𝐶 = 8,73410 − 𝐸; 8,73410 + 𝐸

• 𝐼𝐶 = 8,73410 − 0,83742; 8,73410+0,83742

• 𝐼𝐶 = 7,89668; 9,57152

Conclusão: Há 95% de probabilidade de 𝑦 0, calculado a partir de 𝑥0 = 4, pertencer ao intervalo 7,89668; 9,57152 .

43 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 44: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

ALFABETO GREGO

Anexo

44 diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 45: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

A. Alfabeto grego

45

Nome Pronúncia Minúscula Maiúscula Equivalente latino

Alfa Alpha a

Beta Vita b

Gama Ghama gh = g = j

Delta Dhelta dh = d

Epsilon Épsilon e

Zeta Zita z

Eta Ita e ou h

Teta Thita th = t

Iota Iota i = j

Kapa Kappa k = c = qu

Lambda Lambda l

Mi Mi m

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]

Page 46: Métodos Quantitativos - diegofernandes.weebly.com · Métodos Quantitativos Unidade 4. Estatística inferencial – Parte II diegofernandes.weebly.com 1 Prof. Me Diego Fernandes

B. Alfabeto grego (continuação)

46

Nome Pronúncia Minúscula Maiúscula Equivalente latino

Ni Ni n

Ksi Ksi ou xi ks = cs = ch (X)

Omicron Ômikron o

Pi Pi p

Ro Ro r = rh

Sigma Sigma s

Tau Taf t

Upsilon Ípsilon u = y = i

Phi Fi ph = f

Psi Psi Os

Chi Khi (ri) kh = x (H)

Omega Omega o

diegofernandes.weebly.com Prof. Me Diego Fernandes Emiliano Silva

[email protected]