32
Sampling and Summary Statistics Biology 683 Lecture 2 Heath Blackmon

Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

SamplingandSummaryStatisticsBiology683

Lecture2

HeathBlackmon

Page 2: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Lastweek

• Whataresomecausesofthereproducibilitycrisis?

• Commonproblemsinplots?

Page 3: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Today

1. Terminology2. SummarizingData3. CentralLimitTheorem4. CovarianceandCorrelation

Page 4: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

PopulationsandSamples

• PopulationsSomesortofgroupofsomething- couldbeanything• UndergraduatesatTexasA&M• JewelbeetlesinArizona• Strainoffliesinthelab

• Samples• Asubsetofindividualsdrawnfromapopulation

Page 5: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Whatisthepopulation?

Wewantedtoexamineanyassociationbetweentheseverityofinjuries,andtheheightfromwhichcatsfallinhigh-risebuildings.

IntheperiodbetweenJanuary1,1998andDecember12,2001attheClinicofSurgery,OrthopedicsandOphthalmologyoftheVeterinaryFaculty,119catsweretreatedafterafallorjumpfromabalconyorwindow,wheretheownerssawthefall,orwheretherewasareasonablesuspicionthatafallhadoccurred.Onlythosecatsthatfellfromthesecondorhigherstorieswereincluded.Theownersbroughtthecatsfortreatmentwithinvaryingperiodsoftimeafterthefall(from30mintooveramonth).

Vnuk,etal."Felinehigh-risesyndrome:119cases(1998–2001). JournalofFelineMedicine&Surgery 6.5(2004):305-312.

Page 6: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

SamplingConsiderations

Targetpopulation• Needtosamplearepresentativepopulation• AsampleofpeoplefromCollegeStation,forinstance,would

probablynotberepresentativeofNewYorkers

SamplingError• Chancealonewillcauseyoursampletodepartfromthe

population

Page 7: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Parameter,estimates,samplingconsiderations

Parameter:Population-levelvariableswearetryingtoestimate

EstimateorStatistic:Thevalueoftheparameterinferredfromthesample

Bias:Ifsomethingaboutthesamplingprocedurecausesthesampletosystematicallymisrepresentthepopulation.

Precision:Howtightlygroupedaretheestimates?

Page 8: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

AccuracyvsPrecision

•Precision is a measure of spread

•Accuracy is a measure of bias

Page 9: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

RandomSampling

1. Every unit in a population should have an equal chance of being sampled.

2. The selection of units must be independent.

3. Lots of ways of being non-random…

Page 10: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Yourbigideashouldbeahypothesis

Astatisticalhypothesisisaspecificclaimaboutapopulationparameter

CaloricrestrictionincreasesthelifespanofDrosophilamelanogaster.

Therateofevolutioninwinglessspeciesishigherthanwingedspecies.

Pesticideexposurecausesfeminizationofamphibianmales.

RepetitiveDNAcontentishigherinvenomousthannonvenomousreptiles

Page 11: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Data

VariablesThecharacteristicsthatdifferamongindividuals

DataThemeasurementsofvariablestakenforasampleofindividuals

CategoricalVariablesIndividualsareinqualitativecategories

Page 12: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Data

NumericalVariablesIndividualsvaryonaquantitativescale

OrdinalThecategoriescanbeordered

NominalThecategorieshavenoinherentorder

Page 13: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

ContinuousvsDiscrete

Continuousvariablesavariablethathasaninfinitenumberofpossiblevalues

Discretevariablesavariablethathasafinitenumberofpossiblevalues

Page 14: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

ExplanatoryandResponseVariables

Page 15: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Experimentalvsobservationalstudies

• Doescaloricrestrictionincreaselifespaninmice?• Isglobalwarmingcausedbyhumanactivities?• Doessmokingcauselungcancerinhumans?• Doesparasiteinfectionreducematingsuccessofbeetles?• Doesoxytocinaffectsexualattractioninhumans?• Dosexchromosomesincreasetherateofspeciation?

Page 16: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Whyshouldwesummarizedata?

• Manydatasetsaresimplytoobigtolookatallvaluesandformanimpression?

• Ourimpressionsofsmalldatasetsareoftenmisledbyourtendencytolookforpatterns.

Page 17: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Typicalsummarystatistics

• Mean: Sumoftheobservationsdividedbythenumberofobservations

• Median: Themiddleobservationinasetofdata

• Variance: Theaveragesquareddeviationfromthemean

• StandardDeviation: Thesquarerootofthevariance

Page 18: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Meanandvariance

Page 19: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

BoxPlot

InterquartileRange

Page 20: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

BoxPlot

Rangeofalldata

Page 21: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

BoxPlot

Datapointsmorethan1.5Interquartilerangesawayfromthemedian

Page 22: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

BoxPlot

Page 23: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Symbolsforsamplesandpopulations

SamplesversusPopulationsThemeanorstandarddeviationstatisticyoucalculatefromyoursampleisanestimateofthepopulationparameter.

ParameterSymbols:μ :populationmeanσ :populationstandarddeviation

StatisticSymbols:𝑌" :samplemeans :samplesstandarddeviation

Page 24: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Forasampleofapopulation

Themeanisjust:𝑌" = ∑ %&'&()*

Thestandarddeviationis𝑠 = 𝑠,�

Where𝑠, orthevarianceis:𝑠, = ∑ %&/%" 0'&()*/1

Page 25: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Centrallimittheorem

• Imaginethatwesamplefromthesamepopulationmanytimes,sowehaveabunchofdifferent,independentsamples.

• Eachsamplewillhaveamean,butthemeanswillbedifferentduetochance Inprinciple,wecoulddrawahistogramofthesemeans.

• Ingeneral,youonlyhaveonesamplefromagivenpopulation,however,sowhatcanyouinferaboutthedistributionofthemeansfromyoursample?

• TheCentralLimitTheoremstatesthatregardlessoftheunderlyingpopulationdistributionofthevariableofinterest,thedistributionofthepopulationofmeanswillberoughlynormal.

Page 26: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Centrallimittheorem

Yourestimateofthesamplemeanisanestimateofthemeanofthisdistributionofmeans(thatis,it’syourbestestimateofthepopulationmean).

Thehypotheticaldistributionofsamplemeanshasastandarddeviationequaltosdividedbythesquarerootofn.

𝑆𝐸%" =4*�

Wecallthisstandarddeviationthestandarderrorofthemean(SEM).

Page 27: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Centrallimittheorem

Letstrythat

Page 28: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Estimatingwithuncertainty

Page 29: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Errorbars

• Errorbarscanbeausefulwaytoshowuncertaintywhenit’snotpossibletoshowtheactualdatapoints.

• Usually,theyrepresent1SEorthe95%CI,butnotalways.

• THEFIGURELEGENDSHOULDINDICATEWHATTHEERRORBARSREPRESENT!

Page 30: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

ForThursday

1. Readchapters3WS

Bringlaptoptoclass!

[email protected]

Page 31: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

Yourturn

• Letsdemonstratethatthemeansofsamplesfromanexponentialdistributionarenormallydistributed.

Youwillneed:rexp, hist, mean

Mightuse:for, sample

Page 32: Biology 683 Lecture 2 - GitHub Pagescoleoguy.github.io/teaching/expdes/lec2.pdf · Only those cats that fell from the second or higher stories were included. The owners brought the

BoxPlot