SlideShare a Scribd company logo
1 of 22
Il test consiste nel formulare una ipotesi (ipotesi nulla) e nel verificare se con i dati a disposizione è possibile  rifiutarla  o no . L’ipotesi che viene formulata è  l’ipotesi nulla  (Ho) e rappresenta di solito lo stato di fatto Se il campione fornisce risultati fortemente in contrasto con Ho, questa viene rifiutata a favore dell’ ipotesi alternativa  (H 1 ). Test delle ipotesi
Test della media di una popolazione Eseguiamo il test H 0 :  =  0 Ipotesi nulla  (H 0 ): la media    della popolazione da cui abbiamo estratto il campione è =   0 Ipotesi alternativa  (H 1 ): la media    della popolazione è      0 Verifichiamo quindi se la deviazione della media campionaria da   0  è compatibile con l’ipotesi nulla.  Confrontando la media del campione con   0
Test delle ipotesi Usando una distribuzione campionaria identifichiamo un range di valori che hanno bassa probabilità di accadere se l’ipotesi nulla è vera. Questo range di valori costituisce la cosiddetta regione critica o  regione di rifiuto  dell’ipotesi nulla. Dalla distribuzione campionaria della statistica posso conoscere le probabilità di ottenere determinati valori, e sulla base di queste definire la regione di rifiuto.
Ho:     =   o H 1 :         o ESEMPIO test media di una popolazione Popolazione: Medie campionarie: Distribuzione delle medie campionarie Verifico l’ipotesi che   o = 10 i n una popolazione con     = 6 estraendo a caso un campione di n = 9. Con:
10 ESEMPIO test media di una popolazione Popolazione: Medie campionarie: La regione di rifiuto ha probabilità     (livello di significatività) È la probabilità di rifiutare H 0  quando H 0   è vera Ho:     =10 H 1 :      10 Se    = 0,05 Rifiuto H 0  se la media campionaria è al di fuori dei limiti   0     1.96 (  /  n)
10 ESEMPIO test media di una popolazione Ho:     = 10 H 1 :       10 Popolazione: Medie campionarie: Distribuzione delle medie campionarie (sono noti   =6  e  n=9)
Ho:     =10 H 1 :      10 10 ESEMPIO test media di una popolazione Se    = 0,05 Rifiuto H 0  se la media campionaria è al di fuori dei limiti   0     1.96 (  /  n) Quindi: 10   1.96 ·2 6,08 13,92 6,08 13,92
[object Object],[object Object],[object Object],[object Object],Esempio di fasi da seguire per un test delle ipotesi
4. Rifiuto l’ipotesi nulla se   z   >1.96.  In questo modo si ha una probabilità di rifiuto di 0.05 quando H 0  è vera (e quindi una probabilità di errore di 0,05). ,[object Object],[object Object],[object Object],Test della media di una popolazione
3. Calcolo la probabilità  p  di ottenere il valore di z calcolato:  P(Z< -z) + P(Z>z) ovvero P(Z >   z   ) ( test a 2 code) ,[object Object],[object Object],[object Object],[object Object],[object Object],Test della media di una popolazione con  p value
Significatività e potenza del test
10 Ho:     =10 H 1 :      10 SIGNIFICATIVITÀ E POTENZA DEL TEST 1-   1-    A parità di n (numerosità campionaria) se diminuisco la probabilità dell’errore di I specie (  ) aumento la probabilità dell’errore di II specie (  ). Diminuisce la potenza del test (1-  ).   /2  /2
Test a una o due code Se siamo interessati a rifiutare Ho solo se la differenza è in un senso o nell’altro, eseguiamo il test ad una coda, o test unilaterale. L’ipotesi alternativa sarà  H 1 :     >    o  ovvero  H 1 :     <     o Il vantaggio è che la potenza del test aumenta andando verso  H 1  ma è  praticamente  0 dall’altra parte. 1-   1-    
Se    non è noto si utilizza la sua stima  s  e la relativa stima dell’errore standard: La statistica da usare per il test è t con (n-1) gradi di libertà (GL). Test della media di una popolazione (   ignoto) - Rifiuto l’ipotesi nulla se   t   > t  , (n-1) - Ovvero calcolo la probabilità  p  di trovare t
Test della media di una popolazione (   ignoto) - Rifiuto l’ipotesi nulla se   t   > t  , (n-1) - Ovvero calcolo la probabilità  p  di trovare il t calcolato sotto ipotesi nulla L’ipotesi è sempre Ho:     =   o  contro H 1 :         o   Calcolo t: In pratica per il test al livello di significatività del 5%:
Esempio test della media di una popolazione  (   ignoto) Si afferma che con l’applicazione di una certa dieta dimagrante si perdono 3 kg in un mese. Vengono sottoposte a dieta 64 persone e dopo un mese si verificano i risultati: perdita di peso media = 2,6 kg deviazione standard del campione: 1,2 kg Al livello    = 0.05, il campione è significativamente diverso dall’atteso?
Soluzione Le ipotesi sono: H 0 :    = 3 H 1 :       3 - P(  t   >2,667) = 0,0097 Rifiuto l’ipotesi nulla. Il metodo non funziona come promesso (test a due code) - Rifiuto Ho se   t   >
Esempio test della media di una popolazione  (   ignoto) Un acquirente è interessato all’acquisto di grosse partite di formaggio provenienti dagli alpeggi, ma richiede che le forme siano di peso mediamente superiore ai 2.5 kg  Viene scelto casualmente un campione di 12 forme che vengono pesate Media campionaria: m=2.758 Stima deviazione standard s=0.3942 Al livello di    = 0.1, il campione è  significativamente superiore (test a una coda)  a 2.5 Kg?
P(t >2,267)=0,022 L’ipotesi nulla è rifiutata. Soluzione Le ipotesi sono: H 0 :    = 2,5 H 1 :    > 2,5 (test a una coda) - Rifiuto Ho se t >
Test di una proporzione Una distribuzione binomiale, se ci si riferisce alle proporzioni di successi, è caratterizzata da: Media (valore atteso):   = p Varianza:   2 =  p (1- p ) La proporzione di successi del campione, se  n  è sufficiente, è una variabile casuale con distribuzione approssimativamente normale e:  Media =  p Varianza =  p (1- p )/ n
Posso definire le ipotesi: Ho: p=p o  e  H 1 : p  p o La statistica per il test sarà: Dove  è la proporzione campionaria di successi, trovata con un campione di numerosità n. Se n è sufficientemente grande la distribuzione è proprio quella della normale standardizzata. Posso quindi calcolare i valori critici di z (per significatività prefissate) da confrontare con lo z trovato oppure il  p  value. Test di una proporzione
Esempio test di una proporzione Ho: p= 0,8   e  H 1 : p  0,8 In un campione di 100 osservazioni i successi risultano 75. Posso rifiutare l’ipotesi nulla a livello   =0,05? - P(Z >   z   )=P(Z>1,25) = 0,0528 - Rifiuto l’ipotesi nulla se   z   >1.96. L’ipotesi nulla non è rifiutata

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Test delle ipotesi

  • 1. Il test consiste nel formulare una ipotesi (ipotesi nulla) e nel verificare se con i dati a disposizione è possibile rifiutarla o no . L’ipotesi che viene formulata è l’ipotesi nulla (Ho) e rappresenta di solito lo stato di fatto Se il campione fornisce risultati fortemente in contrasto con Ho, questa viene rifiutata a favore dell’ ipotesi alternativa (H 1 ). Test delle ipotesi
  • 2. Test della media di una popolazione Eseguiamo il test H 0 :  =  0 Ipotesi nulla (H 0 ): la media  della popolazione da cui abbiamo estratto il campione è =  0 Ipotesi alternativa (H 1 ): la media  della popolazione è   0 Verifichiamo quindi se la deviazione della media campionaria da  0 è compatibile con l’ipotesi nulla. Confrontando la media del campione con  0
  • 3. Test delle ipotesi Usando una distribuzione campionaria identifichiamo un range di valori che hanno bassa probabilità di accadere se l’ipotesi nulla è vera. Questo range di valori costituisce la cosiddetta regione critica o regione di rifiuto dell’ipotesi nulla. Dalla distribuzione campionaria della statistica posso conoscere le probabilità di ottenere determinati valori, e sulla base di queste definire la regione di rifiuto.
  • 4. Ho:  =  o H 1 :    o ESEMPIO test media di una popolazione Popolazione: Medie campionarie: Distribuzione delle medie campionarie Verifico l’ipotesi che  o = 10 i n una popolazione con  = 6 estraendo a caso un campione di n = 9. Con:
  • 5. 10 ESEMPIO test media di una popolazione Popolazione: Medie campionarie: La regione di rifiuto ha probabilità  (livello di significatività) È la probabilità di rifiutare H 0 quando H 0 è vera Ho:  =10 H 1 :   10 Se  = 0,05 Rifiuto H 0 se la media campionaria è al di fuori dei limiti  0  1.96 (  /  n)
  • 6. 10 ESEMPIO test media di una popolazione Ho:  = 10 H 1 :   10 Popolazione: Medie campionarie: Distribuzione delle medie campionarie (sono noti  =6 e n=9)
  • 7. Ho:  =10 H 1 :   10 10 ESEMPIO test media di una popolazione Se  = 0,05 Rifiuto H 0 se la media campionaria è al di fuori dei limiti  0  1.96 (  /  n) Quindi: 10  1.96 ·2 6,08 13,92 6,08 13,92
  • 8.
  • 9.
  • 10.
  • 12. 10 Ho:  =10 H 1 :   10 SIGNIFICATIVITÀ E POTENZA DEL TEST 1-  1-   A parità di n (numerosità campionaria) se diminuisco la probabilità dell’errore di I specie (  ) aumento la probabilità dell’errore di II specie (  ). Diminuisce la potenza del test (1-  ).  /2  /2
  • 13. Test a una o due code Se siamo interessati a rifiutare Ho solo se la differenza è in un senso o nell’altro, eseguiamo il test ad una coda, o test unilaterale. L’ipotesi alternativa sarà H 1 :  >  o ovvero H 1 :  <  o Il vantaggio è che la potenza del test aumenta andando verso H 1 ma è praticamente 0 dall’altra parte. 1-  1-   
  • 14. Se  non è noto si utilizza la sua stima s e la relativa stima dell’errore standard: La statistica da usare per il test è t con (n-1) gradi di libertà (GL). Test della media di una popolazione (  ignoto) - Rifiuto l’ipotesi nulla se  t  > t  , (n-1) - Ovvero calcolo la probabilità p di trovare t
  • 15. Test della media di una popolazione (  ignoto) - Rifiuto l’ipotesi nulla se  t  > t  , (n-1) - Ovvero calcolo la probabilità p di trovare il t calcolato sotto ipotesi nulla L’ipotesi è sempre Ho:  =  o contro H 1 :    o Calcolo t: In pratica per il test al livello di significatività del 5%:
  • 16. Esempio test della media di una popolazione (  ignoto) Si afferma che con l’applicazione di una certa dieta dimagrante si perdono 3 kg in un mese. Vengono sottoposte a dieta 64 persone e dopo un mese si verificano i risultati: perdita di peso media = 2,6 kg deviazione standard del campione: 1,2 kg Al livello  = 0.05, il campione è significativamente diverso dall’atteso?
  • 17. Soluzione Le ipotesi sono: H 0 :  = 3 H 1 :   3 - P(  t  >2,667) = 0,0097 Rifiuto l’ipotesi nulla. Il metodo non funziona come promesso (test a due code) - Rifiuto Ho se  t  >
  • 18. Esempio test della media di una popolazione (  ignoto) Un acquirente è interessato all’acquisto di grosse partite di formaggio provenienti dagli alpeggi, ma richiede che le forme siano di peso mediamente superiore ai 2.5 kg Viene scelto casualmente un campione di 12 forme che vengono pesate Media campionaria: m=2.758 Stima deviazione standard s=0.3942 Al livello di  = 0.1, il campione è significativamente superiore (test a una coda) a 2.5 Kg?
  • 19. P(t >2,267)=0,022 L’ipotesi nulla è rifiutata. Soluzione Le ipotesi sono: H 0 :  = 2,5 H 1 :  > 2,5 (test a una coda) - Rifiuto Ho se t >
  • 20. Test di una proporzione Una distribuzione binomiale, se ci si riferisce alle proporzioni di successi, è caratterizzata da: Media (valore atteso):  = p Varianza:  2 = p (1- p ) La proporzione di successi del campione, se n è sufficiente, è una variabile casuale con distribuzione approssimativamente normale e: Media = p Varianza = p (1- p )/ n
  • 21. Posso definire le ipotesi: Ho: p=p o e H 1 : p  p o La statistica per il test sarà: Dove è la proporzione campionaria di successi, trovata con un campione di numerosità n. Se n è sufficientemente grande la distribuzione è proprio quella della normale standardizzata. Posso quindi calcolare i valori critici di z (per significatività prefissate) da confrontare con lo z trovato oppure il p value. Test di una proporzione
  • 22. Esempio test di una proporzione Ho: p= 0,8 e H 1 : p  0,8 In un campione di 100 osservazioni i successi risultano 75. Posso rifiutare l’ipotesi nulla a livello  =0,05? - P(Z >  z  )=P(Z>1,25) = 0,0528 - Rifiuto l’ipotesi nulla se  z  >1.96. L’ipotesi nulla non è rifiutata