SAS STAT. Введение. Дисперсионный анализ (Лекции 2013)
Описание файла
Файл "SAS STAT. Введение. Дисперсионный анализ" внутри архива находится в папке "Лекции 2013". PDF-файл из архива "Лекции 2013", который расположен в категории "". Всё это находится в предмете "(ппп соиад) (sas) пакеты прикладных программ для статистической обработки и анализа данных" из 10 семестр (2 семестр магистратуры), которые можно найти в файловом архиве МГУ им. Ломоносова. Не смотря на прямую связь этого архива с МГУ им. Ломоносова, его также можно найти и в других разделах. .
Просмотр PDF-файла онлайн
Текст из PDF
SAS/STAT LECTURE 1ВВЕДЕНИЕ. ДИСПЕРСИОННЫЙ АНАЛИЗC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .SAS/STAT ОБЗОР КУРСА••••••••ANOVALINEAR REGRESSIONLOGISTIC REGRESSION [perhaps, linear mixed model]GLM:• POISSON REGRESSION & ZERO-INFLATED POISSON• NEGATIVE BINOMIAL REGRESSION• GAMMA REGRESSION• TOBIT MODELSURVIVAL ANALYSISCLUSTERINGBAYESIAN ANALYSIS [hope, next year]SAMPLING [hope, we will have time]C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ПОМОЩЬC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .SAS/STAT ГДЕ ИСКАТЬ ПОМОЩИ….•HTTP://SUPPORT.SAS.COM/DOCUMENTATION/ONLINEDOC/STAT/INDEX.HTML•HTTP://WWW.MACHINELEARNING.RU•HTTP://STANFORD.EDU/ & STARTED 15/10 - HTTP://ML-CLASS.ORG•HTTPS://WWW.GOOGLE.RU/•HTTP://EN.WIKIPEDIA.ORG/WIKI/ANALYSIS_OF_VARIANCE•PAVEL.GREBENNIKOV@SAS.COM•STEPAN.VANIN@SAS.COMC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙ АНАЛИЗC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙПРИМЕРЫ ЗАДАЧАНАЛИЗ•Действительно ли учителя в среднем зарабатывают меньше бухгалтеров?•Правда ли у людей получающих новое лекарство уровень лимфоцитов больше чем улюдей получающих плацебо?•Рыбы живущие в реках около вулканов больше чем рыбы живущие далеко от вулканов?•Влияет ли осведомленность потребителей о магазинах сети «Перекресток» (высокая,средняя, низкая) на предпочтение магазинов именно этой сети?•Как уровень рекламы и/или уровень цен (высокий, средний, низкий) одновременновлияют на объем продаж товаров данной торговой марки?C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙОБЩАЯ ЗАДАЧААНАЛИЗЕсть ли разница между средними характеристики нескольких популяций/выборок/групп?PredictorResponseOne-WayANOVACategoricalContinuousИли по-другому:«Помогает» ли информация о принадлежности к гр пе предсказать значениеисследуемой характеристики?C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ВВЕДЕНИЕ ПЕРЕМЕННЫЕ• Variable type• Continuous: температура, зарплата, возраст, …• Categorical (= class): образование, пол, тип тарифного плана, регион, …• Categorical level of measurement• Nominal: – порядок не определен.• Ordinal: – порядок определен [ => числовые].C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙANOVA И ДРУГИЕ МОДЕЛИАНАЛИЗType ofPredictorsCategoricalContinuousContinuous andCategoricalContinuousAnalysis ofVariance(ANOVA)Ordinary LeastSquares (OLS)RegressionAnalysis ofCovariance(ANCOVA)CategoricalContingencyTable Analysis orLogisticRegressionLogisticRegressionLogistic RegressionType ofResponseC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙЧЕСНОКАНАЛИЗ4 FertilizersC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .32 BedsДИСПЕРСИОННЫЙGARLIC DATASETАНАЛИЗC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙГИПОТЕЗА ДИСПЕРСИОННОГО АНАЛИЗААНАЛИЗH0: F1=F2=F3=F4C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .H1: F1 ≠ F2 or F1 ≠ F3or F1 ≠ F4 or F2 ≠ F3or F2 ≠ F4 or F3 ≠ F4ДИСПЕРСИОННЫЙОСНОВНАЯ ЛОГИКА ДИСПЕРСИОННОГО АНАЛИЗААНАЛИЗVariabilityVariabilitybetween Groups within GroupsСуммыквадратовTotal VariabilityC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .SST=SSM+ SSEДИСПЕРСИОННЫЙСУММЫ КВАДРАТОВ: ПРИМЕРАНАЛИЗC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙСУММЫ КВАДРАТОВ: ПРИМЕР [TOTAL SUM OF SQUARES]АНАЛИЗ(7-6)2(3-6)2C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .SST = (3-6)2 +(4-6)2 +(5-6)2 +(7-6)2 +(8-6)2 +(9-6)2 = 28ДИСПЕРСИОННЫЙСУММЫ КВАДРАТОВ: ПРИМЕР [ERROR SUM OF SQUARES]АНАЛИЗYB 8(7-8)2YA 4C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .(5-4)2SSE = (3-4)2 +(4-4)2 +(5-4)2 +(7-8)2 +(8-8)2 +(9-8)2 = 4ДИСПЕРСИОННЫЙСУММЫ КВАДРАТОВ: ПРИМЕР [MODEL SUM OF SQUARES]АНАЛИЗYB 8(8-6)2YA 4C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .(4-6)2SSM = 3*(4-6)2 +3*(8-6)2 = 24ДИСПЕРСИОННЫЙF STATISTIC AND CRITICAL VALUES AT =0.05АНАЛИЗ .,. ==ModelDF = число групп -1ErrorDF=Nobs-1 – (ModelDF)C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙF STATISTIC SIMPLE “LOGIC”АНАЛИЗYB 8YA 4F >> 1F~1R2= SSM / SSTC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙСПЕЦИФИКАЦИЯ МОДЕЛИАНАЛИЗBulbWt =YikBase+ Fertilizer + UnaccountedLevelfor Variation= + i + ikproc glm data=sasuser.MGGarlic;class Fertilizer;model BulbWt=Fertilizer;title 'Testing for Equality of Means with PROC GLM';run; quit;C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙПРЕДПОЛОЖЕНИЯАНАЛИЗ• Observations are independent• Good data collection designs help ensure the independence assumption• Errors are normally distributed• Diagnostic plots from PROC GLM• All groups have equal variances• PROC GLM produces a test of equal variances with the HOVTEST option inthe MEANS statement.H0 for this hypothesis test is that the variances are equal for allpopulationsif NO then ask for: MEANS <GROUP-VAR> / HOVTEST WELCH;C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙПРИМЕРАНАЛИЗproc glm data=sasuser.MGGarlic plots(only)=diagnostics;class Fertilizer;model BulbWt=Fertilizer;means Fertilizer / hovtest /*WELCH*/;title 'Testing for Equality of Means with PROC GLM';run;quit;C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙФАКТОРЫ-ПОМЕХИАНАЛИЗ?BulbWeightFertilizer??SSTSSMF( , )=MSM / MSEC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .SSEДИСПЕРСИОННЫЙБЛОКИАНАЛИЗ4 FertilizersC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .32 Beds8 SectorsДИСПЕРСИОННЫЙOBSERVATIONAL OR RETROSPECTIVE STUDIESАНАЛИЗ•Groups can be naturally occurring.••Random assignment might be unethical or untenable.•••for example, gender and ethnicityfor example, smoking or credit risk groupsOften you look at what already happened (retrospective) instead offollowing through to the future (prospective).You have little control over other factors contributingto the outcome measure.Design of experiments?C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙCONTROLLED EXPERIMENTSАНАЛИЗ•Random assignment might be desirable to eliminate selection bias.•You often want to look at the outcome measure prospectively.•You can manipulate the factors of interest and can more reasonablyclaim causation.•You can design your experiment to control for other factorscontributing to the outcome measure.C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙДОПОЛНИТЕЛЬНЫЕ ПРЕДПОЛОЖЕНИЯАНАЛИЗ• Additional assumptions are as follows:• Treatments are randomly assigned within each block.• The effects of the treatment factor are constant across the levels of theblocking variable.C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙПРИМЕРАНАЛИЗproc glm data=sasuser.MGGarlic_Block plots(only)=diagnostics;class Fertilizer Sector;model BulbWt=Fertilizer Sector;title 'ANOVA for Randomized Block Design';run;quit;C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙMY GROUPS ARE DIFFERENT. WHAT NEXT?АНАЛИЗTukeyC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .DunnettДИСПЕРСИОННЫЙTUKEY’S MULTIPLE COMPARISON METHODАНАЛИЗThis method is appropriate when you consider pairwise comparisons only.The experimentwise error rate is• equal to alpha when all pairwise comparisons are considered• less than alpha when fewer than all pairwise comparisons areconsidered.C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙCOMPARING TO A CONTROLАНАЛИЗComparing to a control is appropriate when there is a natural referencegroup, such as a placebo group in a drug trial.•Experimentwise error rate is no greater than the stated alpha.•Comparing to a control takes into account the correlations among tests.•One-sided hypothesis tests against a control group can be performed.•Control comparison computes and tests k-1 groupwise differences,where k is the number of levels of the CLASS variable.•An example is the Dunnett method.C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙПРИМЕРАНАЛИЗproc glm data=sasuser.MGGarlic_Blockplots(only)=(controlplot diffplot(center));class Fertilizer Sector;model BulbWt=Fertilizer Sector;lsmeans Fertilizer / pdiff=all adjust=tukey;lsmeans Fertilizer / pdiff=control('4') adjust=dunnett;lsmeans Fertilizer / pdiff=all adjust=t;title 'Garlic Data: Multiple Comparisons';run;quit;C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .
A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙTWO-WAY ANOVA WITH INTERACTIONSАНАЛИЗResponseCategoricalPredictorOne-WayANOVA1 Predictorn-WayANOVAContinuousMore than1 PredictorC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙDRUG EXAMPLEАНАЛИЗThe purpose of the study is to look at the effect of a newprescription drug on blood pressure.C op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c . A l l r i g h t s r es er v e d .ДИСПЕРСИОННЫЙINTERACTIONSАНАЛИЗC op yr i g h t © 2 0 1 3 , S A S I n s t i t u t e I n c .