Quantitative Methods I: Hypothesis Testing And Confidence .

2y ago
20 Views
2 Downloads
406.21 KB
95 Pages
Last View : 17d ago
Last Download : 3m ago
Upload by : Olive Grimm
Transcription

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceQuantitative Methods I:Hypothesis testing and confidence intervalsJohan A. ElkinkUniversity College Dublin29 October 2014Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inference1Statistical inference2Point estimation3Confidence intervals4Hypothesis tests5Bayesian inferenceJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceOutline1Statistical inference2Point estimation3Confidence intervals4Hypothesis tests5Bayesian inferenceJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceStatistical inferenceSummary: amalgamation of data, to reveal interesting commonfeatures of the situation.Comparison: pulling the data apart to reveal interesting differences.Inference: extrapolate from the data to the population.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceStatistical inferenceHypothesis testing relates to the statistical inference ofinteresting comparisons in the sample.(King, 2007; Efron, 1982, 342)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSamplingStatistical inference (or inductive statistics) concerns drawingconclusions regarding a population of cases on the basis of asample, a subset.Sampling refers to the selection of an appropriate subset of thepopulation.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSampling frameThe sampling frame refers to the identifiable list of members ofthe population, from which the sample can be selected.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSimple random samplingEach subject from a population has the exact same chance ofbeing selected in the sample, i.e. the sampling probability foreach subject is the same.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceWeightingOther types of sampling procedures exist, such as stratified orclustering sampling, whereby subsequent weighting of the datacan recover the necessary unbiasedness for statisticalinference.Generally, the weight would be the inverse of the probability ofinclusion in the sample.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceOutline1Statistical inference2Point estimation3Confidence intervals4Hypothesis tests5Bayesian inferenceJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceTerminologyA parameter is a characteric of the population distribution (e.g.the mean µ).A statistics is a function of a sample (e.g. the sample mean x̄).Often we will use a statistic to estimate the value of aparameter, which we will denote with a hat (e.g. x̄ µ̂).Note that the estimator is the random value that estimates thepopulation value, while the estimate is the realized value of theestimator and therefore not random.(King, 2007; Moore, McCabe and Craig, 2012, 198)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceBiasBias is the expected difference between the estimator and theparameter, e.g. Bias(µ̂) E [µ̂ µ].Note that when µ̂ x̄, Bias(µ̂) E [x̄ E[X ]] 0 – the samplemean is an unbiased estimator of the population mean.(King, 2007)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSampling distribution“The sampling distribution of a statistic is the distribution ofvalues taken by the statistic in all possible samples of the samesize from the same population.”(Moore, McCabe & Craig 2012: 201)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSampling distributionTo assess the properties of an estimator, we consider theprobability distribution of the estimator under repeatedsampling, which is called the sampling distribution.The standard deviation of the sampling distribution is called thestandard error.The mean squared error is the expected squared differencebetween the estimator and the parameter:hiMSE(θ̂) E (θ̂ θ)2 Bias(θ̂)2 V (θ̂).(King, 2007)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSampling errorThe amount of error when a population parameter is estimatedor predicted by a sample estimate.The bigger the sample, the lower the sampling error.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceEstimates and uncertaintyWhen we estimate a parameter, we are uncertain what the truevalue is.Besides an estimate of the parameter, we also need anestimate of how certain we are of this estimate.The typical indicator of this is the standard error.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferencei.i.d.We make three assumptions about our data to proceed:The observations are independentThe observations are identically distributedThe population has a finite mean and a finite varianceA variable for which the first two assumptions hold is calledi.i.d.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceIndependent observationsIntuitively: the value for one case does not affect the value foranother case on the same variable.More formally: P(x1 x2 ) P(x1 )P(x2 ).Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceIndependent observationsIntuitively: the value for one case does not affect the value foranother case on the same variable.More formally: P(x1 x2 ) P(x1 )P(x2 ).Examples of dependent observations:grades of students in different classes;stock values over time;economic growth in neighbouring countries.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceIdentically distributedAll the observations are drawn from the same random variablewith the same probability distribution.An example where this is not the case would generally be paneldata. E.g. larger firms will have larger variations in profits, thustheir variance differs, thus these are not observations from thesame probability distribution.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceLaw of large numbersThe law of large numbers (LLN) states that, if these threeassumptions are satisfied, the sample mean will approach thepopulation mean with probability one if the sample is infinitelylarge.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceCentral Limit TheoremIf these three assumptions are satisfied,The sample mean is normally distributed, regardless of thedistribution of the original variable.The sample mean has the same expected value as thepopulation mean (LLN).The standard deviation (standard error) of the sampleσx.mean is: S.E.(x̄) σx̄ nNote that the standard error depends only on the sample size,not on the population size.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceCentral Limit Theorem: unknown σWhen the population variance, σ 2 , is unknown, we can use thesample estimate:sσ̂xσ̂x̄ nPn(xi x̄)2σ̂x2 i 1n 1Johan A. Elkink hypothesis testingσ̂x2n

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceOutline1Statistical inference2Point estimation3Confidence intervals4Hypothesis tests5Bayesian inferenceJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceMargin of errorσxm z c · σx̄ z c · nz c is a relevant critical value of z.See also http://www.joselkink.net/normal01.jpgJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence intervalσxCI x̄ m x̄ z c nJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExampleA sample of 100 respondents shows an average sympathyscore for politician A of 35 (on a 0-100 scale), with a variance of10. What is the 95% confidence interval?Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExampleA sample of 100 respondents shows an average sympathyscore for politician A of 35 (on a 0-100 scale), with a variance of10. What is the 95% confidence interval? 10c σxCI x̄ z 35 1.96 · 35 0.62n100Thus the confidence interval is [34.38; 35.62].Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval of a proportionThe standard error of a proportion isrp̂(1 p̂).SE(p̂) NNote that because only a single parameter p is to be estimatedto get both the mean and the variance, we can use the normalinstead of the t-distribution, and do not divide by N 1 for theestimator of the population variance:σ̂p2 N1X(xi x̄)2 p̂(1 p̂).Ni 1(Benoit, 2009)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval of a proportion: exampleSay, we want to look at the voter support for Vladimir Putin.66% of 1600 respondents in a survey say they will vote forPutin.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval of a proportion: exampleSay, we want to look at the voter support for Vladimir Putin.66% of 1600 respondents in a survey say they will vote forPutin.SE(p̂) qpp̂(1 p̂)/N (.66 · .34)/1600 .012Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval of a proportion: exampleSay, we want to look at the voter support for Vladimir Putin.66% of 1600 respondents in a survey say they will vote forPutin.SE(p̂) qpp̂(1 p̂)/N (.66 · .34)/1600 .012CI95% [p̂ 1.96σp̂ ); p̂ 1.96σp̂ ] [.637; .683]Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval: cautionNote that the confidence interval only takes into account thesampling error.All other errors are ignored, such as measurement error ornon-response bias.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExercise“A student wishes to find the proportion of left-handed people.She surveys 100 fellow students and finds that only 5 areleft-handed. Does a 95% confidence interval contain the value1?”of p 10(Verzani, 2005, 189)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceOutline1Statistical inference2Point estimation3Confidence intervals4Hypothesis tests5Bayesian inferenceJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceHypothesesThe research hypothesis, or alternative hypothesis, is alwayscontrasted to the null hypothesis.Null hypothesis (H0 ): states the assumption that there is no effect ordifference (depending on the research question).Alternative hypothesis (H1 or Ha ): states the research hypothesiswhich we will test assuming the null hypothesis.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceNull hypothesis: exampleNull hypothesis: men have the same thermometer score for BertieAhern as do women.Alternative hypothesis: women have a higher thermometer score forBertie Ahern than do men.H0 : µwomen µmen H1 : µwomen µmenJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceNull hypothesis as basisWhy do we need to assume one of the two hypotheses to testthe other? . Because we need to have some estimate of the samplingdistribution to determine how likely our outcome is. For thisestimate, we use the null hypothesis.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceHypothesis testingGiven the sampling distribution, depending on the distributionand test, we can calculate a test statistic.We can then calculate the probability of observing the observedvalue or more extreme, in the direction of the alternativehypothesis, given the assumptions of the null hypothesis.This is the p-value.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceHypothesis testing: old-fashionedWe used to calculate the critical value given the test statisticand the sampling distribution where we would reject the nullhypothesis.This critical value you can find in tables for the specificprobability distribution.It’s easier to just calculate p-values.Note that you can reject a null hypothesis, but you cannever “accept” a null hypothesis. You either reject or youdo not.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceDensityHypothesis testing: p-valuesFigure: Calculating p-valuesJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceType I and II errorsType I error: rejecting a null hypothesis that is true (e.g.α .05)Type II error: not rejecting a null hypothesis that is false(Davidson and MacKinnon, 1999, 126)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferencePowerPower: probability of rejecting a hypothesis that is false1 P(Type II error)The power of a test increases when:the true value is further from the null hypothesis value;the variance is lower;the sample size is larger.(Davidson and MacKinnon, 1999, 126)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferencep-valueThe p-value is the probability of a Type I error when rejectingthe null hypothesis.You can say a test is “statistically significant” if p α, but thep-value contains more information by itself.(Davidson and MacKinnon, 1999, 128)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceα .05Note that his value is absolutely arbitrary and just habit sincethe publication of Fisher (1923).The p-value is, one could argue, just a complicated way ofmeasuring the sample size.“Another interesting example (.) is the propensity for publishedstudies to contain a disproportionally large number of Type Ierrors; studies with statistically significant results tend to getpublished, whereas those with insignificant results do not.”(Kennedy, 2008, 61)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceα .05(Gerber and Malhotra, 2008)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceHypothesis testing: critical valuesThe α-level refers to critical value, the maximum acceptableprobability that you reject a null hypothesis that is correct.Typical alpha values:α .05: most common in the social sciencesα .01: more common in pharmaceutical researchα .10: less picky social scientistsJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSignificance test for a meanH0 : µ 0H1 : µ 6 0t x̄ 0x̄ µ0 σ̂x̄σ̂x / nct(α .05) 1.96Johan A. Elkink(for large n)hypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceOptimal sample sizeGiven a margin of error m, we can calculate the minimumrequired sample size as: n Johan A. Elkinkz c σxm 2hypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseSuppose a test evaluating students’ motivation, attitude towardsstudy, and study habits, produces a score on a 0-200 scale.The mean score for Irish students is 115.A teacher expects older students to score higher and takes asample of 25 student who are 30 or older. He finds a meanscore x̄ 127.8 and a variance of 30. State the hypothesesand calculate the p-value for a one-sided t-test.See http://www.joselkink.net/t-table.gif for the t-table.(Moore, McCabe and Craig, 2012, 376)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseThe owner of a car which has a board computer that calculates the efficiencyof the engine in km/l performs, in addition, manual calculation by dividing thedistance driven by the liters used each time she fills her tank. After 20 times,she has the following differences between her estimates and those of her 3.74.9-0.63.0-4.2State the hypotheses and perform a t-test whether her estimates differsignificantly from those of her car.(Moore, McCabe and Craig, 2012, 377)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseOpen bes.dta in R.Perform a t-test whether the mean of lr is different from 5(the center of the scale).In the 2005 British parliamentary elections, Labour won40.7% of the vote. Test whether the percentage in thesample (labour) differs.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceTwo-sample t-testx̄1 x̄2t q 2,σ̂1σ̂22 n1n2with degrees of freedom min(n1 1, n2 1).A more exact calculation of the degrees of freedom, inparticular for smaller samples, is: 2σ̂22 2σ̂1 n1n2df 2 2 2 2 .σ̂1σ̂11 n2 1 n22n1 1 n1(Moore and McCabe, 2003, 536)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceTwo-sample t-test in Rt.test(a, b, paired FALSE, var.equal FALSE)For a one-sample t-test, we can use:t.test(a, b, paired TRUE, var.equal FALSE)Or with var.equal TRUE when we can assume equalvariances.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceTwo-sample t-test: exampleImagine an experiment of extra teaching for half a class, with xrepresenting the score on a test at the .0117.15Perform a t-test that the extra teaching significantly helped.(Moore, McCabe and Craig, 2012, 432–433)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceTwo-sample t-test: example51.48 41.52x̄1 x̄2 q 2.31t q 2σ̂1σ̂22(11.01)2(17.15)2 2123n1n2The degrees of freedom are the lowest of n1 1 and n2 1, i.e.20. We can look this up in a table to find 0.01 p 0.02.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceConfidence interval of the differenceThe confidence interval follows then as:sCI (x̄1 x̄2 ) t c ·Johan A. Elkinkσ̂12 σ̂22 n1n2hypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseDoes increased calcium reduce blood 3σ̂8.7435.901Calculate a 95% confidence interval.(Moore, McCabe and Craig, 2012, 444)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseA movie is rated by male and female visitors to a Calculate x̄ and σ̂x for each group.Perform a t-test whether the means differ.(Moore, McCabe and Craig, 2012, 450)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseOpen the bes.dta file.Is trust in politicians in general (trustpol) significantly lowerthan trust in parliament (trustprl)?(Note that this is a paired sample—the same respondentson each variable.)Are voters who turned out to vote (turnout) more likely totrust politicians? (trustpol)?(Note that this is not a paired sample.)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceComparing proportionsRecall, for a dichotomous variable,nσx2 1X(xi x̄)2 p(1 p).ni 1Thus for two proportions we get:t qp1 p2p1 (1 p1 )n1 p2 (1 p2 )n2Only for large samples: see Moore, McCabe and Craig (2012, 588–589) for an adjusted version.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseHere is data from a study on binge drinking among 1,3921,748p̂ ndrinkingnsample0.2600.206Do men binge drink more than women in this sample?Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceComparing proportions: exercise“Immediately after a ban on using of hand-held cell phoneswhile driving was implemented, compliance with the law wasmeasured. A random smaple of 1250 found that 98.9% were incompliance. A year after the implementation, compliance wasagain measured. A sample of 1100 drivers found 96.9% incompliance. Is the difference in proportions statisticallysignificant?”Formulate the null and alternative hypotheses and calculate thep-value using R.(Verzani, 2005, 236)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceComparing proportions: exercise“A cell-phone store has sold 150 phones of Brand A and had 14returned as defective. Additionally, it has sold 125 phones ofBrand B and had 15 phones returned as defective. Is therestatistical evidence that Brand A has a smaller chance of beingreturned than Brand B?”Formulate the null and alternative hypotheses and calculate thep-value using R.(Verzani, 2005, 235)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared testTo check for dependence between two categorical variables,we can make use of the chi-squared test (χ2 -test). Based onthe margins of the table, we can determine the expected valuesof the cells under independence and then calculate whether thecells differ significantly:χ2 X (nobserved nexpected )2nexpectedThe degrees of freedom is calculated as df (r 1)(c 1),with r the number of rows and c the number of columns of thetwo-way table.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferencePearson’s chi-squared statisticχ2 kX (observed expected)2 X(Yi npi )2 expectednpii 1d.f . k 1Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test: examplerecall - c(46.7, 20.1, 8, 25.2)seats - c(45.8, 33.1, 10.2, 10.9)seats.prop - seats / sum(seats)expected - 100 * seats.propchi2 - sum((recall - expected) 2/expected)1 - pchisq(chi2, df 4-1)Or, alternatively:chisq.test(recall, p seats.prop)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test: exerciseVerzani 9.2: The table below “contains the results of a poll of787 registered voters and the actual race results (inpercentages of total votes) in the 2003 gubernatorial recallelection in California. Is the sample data consistent with theactual publicanGreenIndependentPoll 4.0%Table: California gubernatorial recall electionJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independencencnr XX(Yij np̂ij )2χ np̂ij2i 1 j 1d.f . (nr 1)(nc 1)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exampleNo warWarDemocracy403Dictatorship7411Do dictatorships more often have war on their territory thandemocracies?We still need:χ2 X (observed expected)2expectedJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independenceSo how to calculate expected values for a cross-table?Basic intuition: if the two variables were independent of eachother, the relative proportions should be similar to the marginaldistributions.E.g. the proportion of democracies at war should be similar tothe proportion of countries at war.Since we have two margins, we need to calculate theproportion as:p̂democracy,war p̂democracy p̂warJohan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exampleNo warWarDemocracy114/128 43/12814/128 43/12843/128No warWarDemocracy.299.037.336Johan A. ElkinkDictatorship114/128 85/12814/128 85/12885/128Dictatorship.591.073.664hypothesis testing.891.1091114/12814/1281

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exampleNo warWarχ2 7Dictatorship7475.7119.3(40 38.3)2 (74 75.7)2 (3 4.7)2 (11 9.3)2 1.04338.375.74.79.31 - pchisq(1.043, df (2-1) * (2-1))Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exampleNo warWarDemocracy403Dictatorship7411Do dictatorships more often have war on their territory thandemocracies?table - rbind(c(40,74), c(3,11))chisq.test(table)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exerciseCountry 1945Country 1945Most non-free171286369468511176921Most free36Is there an association between the age of the country and thelevel of freedom, according to the Freedom House scores?Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceChi-squared test of independence: exerciseThe table below “contains data on the severity of injuriessustained during car crashes. The data is tabulated by whetheror not the passenger wore a seat belt. Are the two variablesindependent?”Seat beltInjury ,642major42303(Verzani, 2005, 264–265)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExerciseExecuting the test in R (chisq.test()) delivers a p-value justlike with the t-test.Perform a test for the relation between:euvote and labour.turnout and labour.Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceComparing variancesThe ratio of two variances of normally distributed variables hasan F -distribution. We can therefore use the Fisher’s test forequal variances to compare two variances, which is a standardF -test:s2F X2 .sYIn R: var.test(a, b).If the two variables are not normally distributed, there is thenon-parametric Wilcoxon rank sum test, using wilcox.test(a,b).(Benoit, 2009)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceExercises“Two different AIDS-treatment ‘cocktails’ are compared. Foreach, the time it takes (in years) to fail is measured for sevenrandomly assigned patients. The data is below. Find an 80%confidence interval for the difference of means and thedifference in variance.”TypeCocktail 1Cocktail x̄2.242.13S0.990.69Table: Time to fail for AIDS cocktails, in years(Verzani, 2005, 206)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesis testsBayesian inferenceSignificance test for Pearson’s rH0 : rx,y 0H1 : rx,y 6 0rt rN 21 r2In R: cor.test().(Benoit, 2009)Johan A. Elkinkhypothesis testing

Statistical inferencePoint estimationConfidence intervalsHypothesi

inclusion in the sample. Johan A. Elkink hypothesis testing. Statistical inference Point estimation . Johan A. Elkink hypothesis testing. Statistical inference Point estimation Confidence intervals Hypothesis tests Bayesian inference Terminology Aparameteris a characteric of the population distribution (e.g. . large. Johan A. Elkink .

Related Documents:

Texts of Wow Rosh Hashana II 5780 - Congregation Shearith Israel, Atlanta Georgia Wow ׳ג ׳א:׳א תישארב (א) ׃ץרֶָֽאָּהָּ תאֵֵ֥וְּ םִימִַׁ֖שַָּה תאֵֵ֥ םיקִִ֑לֹאֱ ארָָּ֣ Îָּ תישִִׁ֖ארֵ Îְּ(ב) חַורְָּ֣ו ם

Detection and Hypothesis testing Rejecting a hypothesis aka detection H 0: The \null" hypothesis i.e., the hypothesis that the data might allow you to reject H 1: The alternate hypothesis Example: H 0: Average IQ of Group1 subjects Group2 subjects H 1: Average IQ of Group1 subjects Group2 subjects Given data we wish to probabilistically test out the hypotheses

Hypothesis testing is a statistical technique that is used in a variety of situations. Testing a hypothesis involves Deducing the consequences that should be observable if the hypothesis is correct. Selecting the research methods that will permit

Lecture 7: Hypothesis Testing and ANOVA. Goals Introduction to ANOVA Review of common one and two sample tests Overview of key elements of hypothesis testing. . the test statistic under the null hypothesis and assumptions about the distribution of the sample data (i.e., normality)

HYPOTHESIS TESTING Hypothesis testing –Testing an assertion about a population based on a random sample. –Example: Hypothesis: a given coin is fair Test: flip the coin 100 times, count the number of heads –If the coin is fair, we expect approximately 50 heads. –E.g. if the number of heads is in [47, 53], the hypothesis is true .

7. Know that your hypothesis may change over time as your research progresses. You must obtain the professor's approval of your hypothesis, as well as any modifications to your hypothesis, before proceeding with any work on the topic. Your will be expressing your hypothesis in 3 ways

Cover photo: Yasgur farm, Woodstock, New York revision date 15 JULY 2009 HYPOTHESIS TESTING COMPARED TO JURY TRIALS 3 COMPARISONS BETWEEN HYPOTHESIS TESTS AND JURY DECISION-MAKING General Specific Example Criminal Trial Null Hypothesis H0

Python allows you to split your program into modules that can be reused in other Python programs. It comes with a large collection of standard modules that you can use as the basis of your programs. The Python Standard Library consists of different modules for handling file I/O, basic mathematics, etc.