1 Arithmetic mean xin Geometric mean x 1x

  • Slides: 104
Download presentation

* מרכזית לנטייה מדדים ממוצע. 1 הרמוני , גיאומטרי , חשבוני Arithmetic mean: Σxi/n

* מרכזית לנטייה מדדים ממוצע. 1 הרמוני , גיאומטרי , חשבוני Arithmetic mean: Σxi/n Geometric mean: (x 1*x 2*…*xn)1/n Harmonic mean: * = Moments of central tendency

R- ב מרכזית לנטייה מדדים Arithmetic mean: Σxi/n : דוגמא חשבוני ממוצע. 1 “mean”

R- ב מרכזית לנטייה מדדים Arithmetic mean: Σxi/n : דוגמא חשבוני ממוצע. 1 “mean” הפונקציה data<-c(2, 3, 4, 5, 6, 7, 8) mean(data) [1] 5 Geometric mean: (x 1*x 2*…*xn)1/n גיאומטרי ממוצע. 2 : מהקובץ לעבוד גם ניתן dat<-read. csv("island_type_final 2. csv") Attach(dat) mean(lat) [1] 17. 40439 : דוגמא data<-c(2, 3, 4, 5, 6, 7, 8) exp(mean(log(data))) [1] 4. 549163

 מרכזית לנטייה מדדים #for: data<-c(2, 3, 4, 5, 6, 7, 8) length(data) var(data)

מרכזית לנטייה מדדים #for: data<-c(2, 3, 4, 5, 6, 7, 8) length(data) var(data) : מדגם גודל : שונות sd(data) : תקן סטיית se<-(sd(data)/length(data)^0. 5) se [1] 0. 8164966 : תקן שגיאת CV<-sd(data)/mean(data) CV [1] 0. 4320494 : coefficient of variation

 מרכזית לנטייה מדדים (Skew) הטייה skew<-function(data){ m 3<-sum((data-mean(data))^3)/length(data) s 3<-sqrt(var(data))^3 m 3/s 3}

מרכזית לנטייה מדדים (Skew) הטייה skew<-function(data){ m 3<-sum((data-mean(data))^3)/length(data) s 3<-sqrt(var(data))^3 m 3/s 3} skew(data) sdskew<-function(x) sqrt(6/length(x)) : הטיה של תקן שגיאת

 מרכזית לנטייה מדדים (Kurtosis) קורטוזיס. 1 kurtosis<-function(x){ m 4<-sum((x-mean(x))^4)/length(x) s 4<-var(x)^2 m 4/s

מרכזית לנטייה מדדים (Kurtosis) קורטוזיס. 1 kurtosis<-function(x){ m 4<-sum((x-mean(x))^4)/length(x) s 4<-var(x)^2 m 4/s 4 -3 } kurtosis(x) sdkurtosis<-function(x) sqrt(24/length(x)) : קורטוזיס של תקן שגיאת

Residuals המציאות של מודלים יוצרים אנחנו סטטיסטיקה עושים כשאנחנו dat<-read. csv("island_type_final 2. csv") model<-lm(mass~iso+area+age+lat,

Residuals המציאות של מודלים יוצרים אנחנו סטטיסטיקה עושים כשאנחנו dat<-read. csv("island_type_final 2. csv") model<-lm(mass~iso+area+age+lat, data=dat) out<-model$residuals out write. table(out, file = "residuals. txt", sep="t", col. names=F, row. names=F) #note that residual values are in the order entered (i. e. , not alphabetic, not by residual size – first in, first out) Residual = ₪ 37428 Residual = 33 cm Residual = -23 month service

* שכיחויות התפלגות dat<-read. csv("island_type_final 2. csv") attach(dat) names(dat) Hist(mass) כמה תצפיות יש בכל

* שכיחויות התפלגות dat<-read. csv("island_type_final 2. csv") attach(dat) names(dat) Hist(mass) כמה תצפיות יש בכל (bin) קטגוריה התצפיות מרחב כל את מבטאת * = frequency distribution, in graphic form = “histogram”

 שכיחויות התפלגות מכוערת כך כל להיות חייבת לא dat<-read. csv("island_type_final 2. csv") attach(dat)

שכיחויות התפלגות מכוערת כך כל להיות חייבת לא dat<-read. csv("island_type_final 2. csv") attach(dat) hist(mass, col="purple", breaks=25, xlab="log mass (g)", main="masses of island lizards - great data by Maria", cex. axis=1. 2, cex. lab=1. 5)

 אחר רציף משתנה לעומת קטגורי משתנה הצגת dat<-read. csv("island_type_final 2. csv") attach(dat) plot(type,

אחר רציף משתנה לעומת קטגורי משתנה הצגת dat<-read. csv("island_type_final 2. csv") attach(dat) plot(type, brood) !bar plot על Box & Whiskers plot העדיפו תמיד

 אחר רציף משתנה לעומת רציף משתנה הצגת dat<-read. csv("island_type_final 2. csv") attach(dat) plot(mass,

אחר רציף משתנה לעומת רציף משתנה הצגת dat<-read. csv("island_type_final 2. csv") attach(dat) plot(mass, clutch, pch=16, col="blue“)

Binomial test in R. הכולל המדגם גודל מתוך ההצלחות מספר את להגדיר יש 20

Binomial test in R. הכולל המדגם גודל מתוך ההצלחות מספר את להגדיר יש 20 מתוך 19 : 2 דוגמה binom. test(19, 34) . ( מובהק )לא 34 מתוך 19 : 1 דוגמה ( )מובהק Exact binomial test data: 19 and 34 number of successes = 19, number of trials = 34 p-value = 0. 6076 alternative hypothesis: true probability of success is not equal to 0. 5 95 percent confidence interval: 0. 3788576 0. 7281498 sample estimates: probability of success 0. 5588235 binom. test(19, 20) Exact binomial test data: 19 and 20 number of successes = 19, number of trials = 20, p-value = 4. 005 e-05 alternative hypothesis: true probability of success is not equal to 0. 5 95 percent confidence interval: 0. 7512672 0. 9987349 sample estimates: probability of success 0. 95

Chi-square test in R Data: lizard insularity & diet: chisq. test habitat island mainland

Chi-square test in R Data: lizard insularity & diet: chisq. test habitat island mainland M<-as. table(rbind(c(1901, 101, 269), c(488, 43, 177))) chisq. test(M) data: M χ2 = 80. 04, df = 2, p-value < 2. 2 e-16 diet carnivore herbivore omnivore species# 488 43 177 1901 101 269

Chi-square test in R chisq. test : שלנו הנתונים בסיס עם והפעם dat<-read. csv("island_type_final

Chi-square test in R chisq. test : שלנו הנתונים בסיס עם והפעם dat<-read. csv("island_type_final 2. csv") type anoles else install. packages("reshape") Continental 7 45 Library(reshape) Land_bridge 1 30 cast(dat, type ~ what, length) Oceanic M<-as. table(rbind(c(7, 45), c(1, 30, 14), c(23, 110, 44))) chisq. test(M) data: M χ2 = 17. 568, df = 4, p-value = 0. 0015 23 110 gecko 45 14 44

t-test in R t. test(x, y) dimorphism<-read. csv("ssd. csv", header=T) attach(dimorphism) names(dimorphism) males<-size[Sex=="male"] females<-size[Sex=="female"]

t-test in R t. test(x, y) dimorphism<-read. csv("ssd. csv", header=T) attach(dimorphism) names(dimorphism) males<-size[Sex=="male"] females<-size[Sex=="female"] t. test(females, males) Sex female male female male female size 79. 7 85 120 133. 0 118 126. 0 105. 8 112 106 121. 0 95 111. 0 86 93. 0 65 75. 0 230 240. 0 Welch Two Sample t-test data: females and males t = -2. 1541, df = 6866. 57, p-value = 0. 03127 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 7. 5095545 -0. 3536548 sample estimates: mean of x mean of y 88. 17030 92. 10191

t-test in R (2) Sex female male female male female lm(x~y) dimorphism<-read. csv("ssd. csv",

t-test in R (2) Sex female male female male female lm(x~y) dimorphism<-read. csv("ssd. csv", header=T) attach(dimorphism) names(dimorphism) model<-lm(size~Sex, data=dimorphism) summary(model) (Intercept) Sexmale Estimate 88. 17 3. 932 standard error 1. 291 1. 825 t 68. 32 2. 154 p value <2 e-16 *** 0. 031 * size 79. 7 85 120 133. 0 118 126. 0 105. 8 112 106 121. 0 95 111. 0 86 93. 0 65 75. 0 230 240. 0

Species Xenagama_zonura Xenosaurus_grandis Xenosaurus_newmanorum Xenosaurus_penai Xenosaurus_platyceps Xenosaurus_rectocollaris Zonosaurus_anelanelany Zootoca_vivipara Zygaspis_nigra Zygaspis_quadrifrons Paired t-test in

Species Xenagama_zonura Xenosaurus_grandis Xenosaurus_newmanorum Xenosaurus_penai Xenosaurus_platyceps Xenosaurus_rectocollaris Zonosaurus_anelanelany Zootoca_vivipara Zygaspis_nigra Zygaspis_quadrifrons Paired t-test in R t. test(x, y, paired=TRUE) dimorphism<-read. csv("ssd. csv", header=T) attach(dimorphism) names(dimorphism) males<-size[Sex=="male"] females<-size[Sex=="female"] t. test(females, paired=TRUE) size 79. 7 85 120 133. 0 118 126. 0 105. 8 112 106 121. 0 95 111. 0 86 93. 0 65 75. 0 230 240. 0 195 227. 0 Sex female male female male female Paired t-test data: females and males t = -10. 192, df = 3503, p-value < 2. 2 e-16 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -4. 688 -3. 175 sample estimates: mean of the differences -3. 931 tapply(size, Sex, mean) female 88. 17 male 92. 10

species Trachylepis_sechellensis Trachylepis_wrightii Tropidoscincus_boreus Tropidoscincus_variabilis Urocotyledon_inexpectata Varanus_beccarii Algyroides_fitzingeri Anolis_wattsi Archaeolacerta_bedriagae Cnemaspis_affinis Cnemaspis_limi Cnemaspis_monachorum Amblyrhynchus_cristatus

species Trachylepis_sechellensis Trachylepis_wrightii Tropidoscincus_boreus Tropidoscincus_variabilis Urocotyledon_inexpectata Varanus_beccarii Algyroides_fitzingeri Anolis_wattsi Archaeolacerta_bedriagae Cnemaspis_affinis Cnemaspis_limi Cnemaspis_monachorum Amblyrhynchus_cristatus Ameiva_erythrocephala island<-read. csv("island_type_final 2. csv", header=T) Ameiva_fuscata names(island) Ameiva_plei [1] "species" "what" "family" "insular" "Archipelago" "largest_island" Anolis_acutus [7] "area" "type" "age" "iso" "lat" "mass" Anolis_aeneus [13] "clutch" "brood" "hatchling" "productivity“ Anolis_agassizi Anolis_bimaculatus model<-aov(clutch~type, data=island) Anolis_bonairensis ANOVA in R aov model<-aov(x~y) summary(model) Df type 2 Residuals 289 Sum sq Mean sq F value Pr(>F) 0. 466 0. 23296 2. 784 0. 0635. 24. 184 0. 08368 type Continental Continental Land_bridge Land_bridge Oceanic Oceanic Oceanic clutch 0. 65 0. 45 0. 3 0. 58 0. 4 0 0. 65 0. 3 0. 18 0 0. 35 0. 6 0. 41 0 0. 18 0

R- ב ANOVA- ל post-hoc מבחן Tukey. HSD(model) Tukey multiple comparisons of means 95%

R- ב ANOVA- ל post-hoc מבחן Tukey. HSD(model) Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = clutch ~ type, data = island) $type Land_bridge-Continental Oceanic-Land_bridge diff 0. 124 0. 0218 -0. 102 lwr -0. 0025 -0. 0671 -0. 2206 upr 0. 2505 0. 1108 0. 0163 תמיד שאפס לב מובהקים )שימו אינם ההבדלים פלטות לאיי יבשת מדף איי בין ההבדל. הסמך ברווח (p = 0. 056 , למובהקות קרוב טקטוניות p adj 0. 0561 0. 8318 0. 1066

correlation in R cor. test(x, y) island<-read. csv("island_type_final 2. csv", header=T) names(island) [1] "species"

correlation in R cor. test(x, y) island<-read. csv("island_type_final 2. csv", header=T) names(island) [1] "species" "what" "family" "insular" "Archipelago" "largest_island" [7] "area" "type" "age" "iso" "lat" "mass" [13] "clutch" "brood" "hatchling" "productivity“ attach(island) cor. test(mass, lat) Pearson's product-moment correlation data: mass and lat t = -1. 138, df = 317, p-value = 0. 256 alternative hypothesis: true correlation is not equal to 0 95 percent confidence interval: -0. 17239 0. 04635 sample estimates: cor -0. 06378 r הקורלציה מקדם הוא “cor” המשתנה lat 5 5 4 18 18 18 20 18 18 18 5 21 21 21 22 21 mass 1. 21 0. 83 1. 84 1. 39 0. 42 0. 29 0. 45 1. 54 0. 36 0. 27 0. 04 0. 01 1. 21 0. 95 0. 51 0. 29 0. 74 0. 92

regression in R כמו נתונים אותם הקודמת בדוגמה lm (=“linear model”): lm (y~x) model<-lm(mass~lat,

regression in R כמו נתונים אותם הקודמת בדוגמה lm (=“linear model”): lm (y~x) model<-lm(mass~lat, data=island) summary(model) Call: lm(formula = mass ~ lat, data = island) Residuals: Min 1 Q Median 3 Q Max -4. 708 -1. 774 0. 470 1. 465 3. 725 Coefficients: (Intercept) lat Estimate 0. 958034 -0. 00554 Std. Error 0. 096444 0. 004872 t value 9. 934 -1. 138 Pr(>|t|) <2 e-16 *** 0. 256 Residual standard error: 0. 8206 on 317 degrees of freedom Multiple R-squared: 0. 004069, Adjusted R-squared: 0. 0009268 F-statistic: 1. 295 on 1 and 317 DF, p-value: 0. 256

lm לעומת aov. lm במבחן גם ANOVA- ל המתאימים נתונים לבחון אפשר במפתיע אולי

lm לעומת aov. lm במבחן גם ANOVA- ל המתאימים נתונים לבחון אפשר במפתיע אולי (! כולל )חשוב , רגרסיה במבחן lm של summary- ה שנותן המידע כל את נקבל כזה במקרה 2 קונטרסט )בין לכל p- וערכי פקטורים בין הבדלים , תקן שגיאות , parameter estimates ( הקטגוריאלי המסביר המשתנה של קטגוריות island<-read. csv("island_type_final 2. csv", header=T) model<-aov(clutch~type, data=island) model 2<-lm(clutch~type, data=island) summary(model 2) Df type 2 Residuals 289 (Intercept) type. Land_bridge type. Oceanic Sum sq Mean sq F value Pr(>F) 0. 466 0. 23296 2. 784 0. 0635. 24. 184 0. 08368 Estimate 0. 33149 0. 12399 0. 02184 Std. Error 0. 02984 0. 05369 0. 03777 t value 11. 11 2. 309 0. 578 Residual standard error: 0. 2893 on 289 degrees of freedom (27 observations deleted due to missingness) Multiple R-squared: 0. 0189, Adjusted R-squared: 0. 01211 F-statistic: 2. 784 on 2 and 289 DF, p-value: 0. 06346 aov טבלת Pr(>|t|) <2 e-16 0. 0216 0. 5635 *** * בהמשך עוד lm טבלת

ANOVA. א פרמטריים מבחנים של הנחותיהם מבחן כל של להנחות בנוסף (Homoscedasticity) שוניות שיוויון.

ANOVA. א פרמטריים מבחנים של הנחותיהם מבחן כל של להנחות בנוסף (Homoscedasticity) שוניות שיוויון. 1 residuals- ה של נורמלית התפלגות. 2 "Comments on earlier drafts of this manuscript made it clear that for many readers who analyze data but who are not particularly interested in statistical questions, any discussion of statistical methods becomes uncomfortable when the term ‘‘error variance’’ is introduced. “ Smith, R. J. 2009. Use and misuse of the reduced major axis for linefitting. American Journal of Physical Anthropology 140: 476 -486. Richard Smith & 3 friends : קריאה Sokal & Rohlf 1995. Biometry. 3 rd edition. Pages 392 -409 (especially 406 -407 for normality)

Always look at your data Don’t just rely on the statistics! Anscombe's quartet Summary

Always look at your data Don’t just rely on the statistics! Anscombe's quartet Summary statistics are the same for all four data sets: • • mean (7. 5), standard deviation (4. 12) correlation (0. 816) regression line (y = 3 + 0. 5 x) Anscombe 1973. Graphs in statistical analysis. The American Statistician 27: 17– 21. Briggs Henan University 2010 40

 רגרסיה : ב פרמטריים מבחנים של הנחותיהם (Homoscedasticity) שונויות שוויון. 1 Smith, R.

רגרסיה : ב פרמטריים מבחנים של הנחותיהם (Homoscedasticity) שונויות שוויון. 1 Smith, R. J. 2009. Use and misuse of the reduced major axis for line-fitting. American Journal of Physical Anthropology 140: 476 -486.

 רגרסיה : ב פרמטריים מבחנים של הנחותיהם (Homoscedasticity) שונויות שוויון. 1 שגיאה ללא

רגרסיה : ב פרמטריים מבחנים של הנחותיהם (Homoscedasticity) שונויות שוויון. 1 שגיאה ללא ( נמדד explanatory variable) המסביר המשתנה. 2 Smith, R. J. 2009. Use and misuse of the reduced major axis for line-fitting. American Journal of Physical Anthropology 140: 476 -486.

R- ב פרמטריים - א מבחנים Orycteropus afer להרצאה קשר אין למצולם התפלגויות שתי

R- ב פרמטריים - א מבחנים Orycteropus afer להרצאה קשר אין למצולם התפלגויות שתי להשוואת פרטרי - א מבחן הוא סמירנוב - קולמוגורוב דוגמת – ידועה להתפלגות " "שלנו התפלגות השוואת )או שכיחויות ( הנורמלית בין להשוות רוצים שאנו נאמר : response- ה ואת grouping variable- ה את R- ל להגדיר צריך : אוקייניים ואיים יבשת מדף באיי לטאות של הגוף מסת של השכיחויות התפלגויות island<-read. csv("island_type_final 2. csv", header=T) attach(island) levels(type) [1] "Continental" "Land_bridge" "Oceanic“ Land_bridge<-mass[type=="Land_bridge"] Two-sample Kolmogorov-Smirnov test Oceanic <-mass[type==" Oceanic"] data: Land_bridge and Oceanic ks. test(Land_bridge, Oceanic) D = 0. 1955, p-value = 0. 1288 alternative hypothesis: two-sided

R- ב פרמטריים - א מבחנים t מבחן המחליף פרטרי - א מבחן הוא

R- ב פרמטריים - א מבחנים t מבחן המחליף פרטרי - א מבחן הוא Mann-Whitney U = Wilcoxon rank sum ? (Lacertidae) לטאות של ונקבות זכרים ( בין SVL) הגוף בגודל הבדל יש האם ssd<-read. table("dimorphism. txt", header=T) attach(ssd) names(ssd) [1] "binomial" "sex" "svl" male<-svl[sex=="male"] female<-svl[sex=="female"] wilcox. test(male, female, paired=FALSE) Wilcoxon rank sum test with continuity correction data: male and female W = 15396, p-value = 0. 1493 alternative hypothesis: true location shift is not equal to 0

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test ( כאשר Lacertidae) לטאות של ונקבות זכרים ( בין SVL) הגוף בגודל הבדל יש האם ? מין אותו של הזוויגים בין משווים ssd<-read. table("dimorphism. txt", header=T) attach(ssd) names(ssd) [1] "binomial" "sex" "svl" male<-svl[sex=="male"] female<-svl[sex=="female"] wilcox. test(male, female, paired=TRUE) Wilcoxon rank sum test with continuity correction data: male and female V = 8822. 5, p-value = 1. 773 e-06 alternative hypothesis: true location shift is not equal to 0

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test ( כאשר Lacertidae) לטאות של ונקבות זכרים ( בין SVL) הגוף בגודל הבדל יש האם ? מין אותו של הזוויגים בין משווים names(ssd) [1] "binomial" "sex" "svl" wilcox. test(male, female, paired=TRUE) המין לפי מזווג יהיה שהמבחן רוצים אנחנו : בעיה כאן יש אבל ! זאת הגדרנו לא מקום בשום אבל – (binomial) Wilcoxon rank sum test with continuity correction data: male and female V = 8822. 5, p-value = 1. 773 e-06 alternative hypothesis: true location shift is not equal to 0

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test

R- ב פרמטריים - א מבחנים paired-t מבחן מחליף Wilcoxon two-sample (=Wilcoxon signed-rank) test ? מין אותו של הזוויגים בין משווים כאשר לטאות של ונקבות זכרים של הגוף בגודל הבדל יש האם )מה למטריצה הנתונים את נהפוך בעצם : recast- ב נשתמש ( סטטיסטיות תוכנות עם בעבודה ממנו להמנע מנסים כלל שבדרך sex<-recast(ssd, binomial~sex, measure. var = "svl") names(sex) [1] "binomial" "female" "male" sex wilcox. test(sex$female, sex$male, paired=TRUE) Wilcoxon signed rank test with continuity correction data: sex$female and sex$male V = 3423. 5, p-value = 1. 773 e-06

R- ב פרמטריים - א מבחנים one-way ANOVA מבחן מחליף Kruskal-Wallis אותו ANOVA מבחן

R- ב פרמטריים - א מבחנים one-way ANOVA מבחן מחליף Kruskal-Wallis אותו ANOVA מבחן של לקוד מאוד דומה זה למבחן הקוד kruskal. test נכתוב aov שבמקום רק , מחליף הוא island<-read. csv("island_type_final 2. csv", header=T) Attach(island) kruskal. test(clutch~type) Kruskal-Wallis rank sum test data: clutch by type Kruskal-Wallis chi-squared = 7. 1639, df = 2, p-value = 0. 02782

R- ב פרמטריים - א מבחנים קורלציה מבחן מחליפים Kendall’s-tau ומבחן Spearman מבחן ידי

R- ב פרמטריים - א מבחנים קורלציה מבחן מחליפים Kendall’s-tau ומבחן Spearman מבחן ידי על , קורלציה למבחן הרגיל הקוד על וריאציה הוא פה הקוד למעשה “method” בפרמטר הרלוונטי פרמטרי - הא למבחן ההגדרה הוספת נכתוב cor. test(clutch, mass) : לכתוב במקום cor. test(clutch, mass, method="spearman") #or cor. test(clutch, mass, method="kendall") : בהתאמה ונקבל Spearman's rank correlation rho data: clutch and mass S = 1907900, p-value < 2. 2 e-16; rho 0. 5402 Kendall's rank correlation tau data: clutch and mass z = 9. 747, p-value < 2. 2 e 16; tau 0. 4059

Non-linear models. לינארי אינו response ל predictor ה בין שהיחס ברור לעיתים breakpoint )

Non-linear models. לינארי אינו response ל predictor ה בין שהיחס ברור לעיתים breakpoint ) מודלים לבחון ניתן משוואות יש ( בהם regression ה של שונים לערכים שונות לינאריות predictor Y = A 1. x + K 1 for x < breakpoint Y = A 2. x + K 2 for x > breakpoint Losos & Schluter 2000. Analysis of an evolutionary species-area relationship. Nature 408: 847 -850.

R- ב ANCOVA מודל תוצאות קריאת ללא דוגמא אינטראקציות Response = intercept + a

R- ב ANCOVA מודל תוצאות קריאת ללא דוגמא אינטראקציות Response = intercept + a for level 1 of the 1 st categorical predictor variable or + b for level 2 of the 1 st + c for level 1 of the 2 nd categorical predictor or d for level 2… +k*(value of the continuous predictor variable) + error Tooth / sex לשועלים נחזור אם , למשל Latitude factor Estimate Std. Error Intercept (tooth c) 4. 342 0. 078 55. 92 tooth_m 8. 485 0. 038 224. 21 0. 0001< tooth_p 6. 617 0. 038 174. 84 0. 0001< sex_male 0. 391 0. 031 12. 56 0. 0001< Latitude 0. 043 0. 001 29. 06 0. 0001< t p 0. 0001< : הוא המודל פי ( על 32 רוחב אביב )קו בתל בזכרים P שן של שהאורך כך 12. 726 = 4. 342+6. 617+0. 391+32*0. 043

R- ב lm של תוצאות קוראים איך רציפים וגם קטגוריאלים מסבירים משתנים גם :

R- ב lm של תוצאות קוראים איך רציפים וגם קטגוריאלים מסבירים משתנים גם : ANCOVA model 4<-lm(brood~mass+lat+type, data=island) summary(model 4) Estimate (Intercept) 1. 177011 mass -0. 2402 lat -0. 01864 type. Land_bridge -0. 2175 type. Oceanic -0. 06551 Std. Error 0. 134218 0. 035362 0. 003677 0. 108051 0. 095145 t value 8. 769 -6. 793 -5. 068 -2. 013 -0. 689 Pr(>|t|) 5. 62 E-13 2. 66 E-09 3. 00 E-06 0. 0479 0. 4933 *** *** * Residual standard error: 0. 2771 on 72 degrees of freedom (242 observations deleted due to missingness) Multiple R-squared: 0. 478, Adjusted R-squared: 0. 449 F-statistic: 16. 48 on 4 and 72 DF, p-value: 1. 25 e-09 . בכללותו המודל של ' וכו F , חופש דרגות , R 2 ערכי אלה ריקים מתאים התעלם R- ש לב שימו

relevel (2) model 4<-lm(brood~mass+lat+type, data=island) summary(model 4) את ישווה הוא אליו , הראשון הגורם

relevel (2) model 4<-lm(brood~mass+lat+type, data=island) summary(model 4) את ישווה הוא אליו , הראשון הגורם יהיה מי R- ל להגדיר : להתחכם אפשר : relevel הפקודה ידי על , האחרים model 4 a<-lm(brood~mass+lat+relevel(type, "Land_bridge"), data=island) summary(model 4 a) או model 4 b<-lm(brood~mass+lat+relevel(type, "Oceanic"), data=island) summary(model 4 b)

relevel (3) את ישווה הוא אליו , הראשון הגורם יהיה מי R- ל להגדיר

relevel (3) את ישווה הוא אליו , הראשון הגורם יהיה מי R- ל להגדיר : להתחכם אפשר : relevel הפקודה ידי על , האחרים model 4 a<-lm(brood~mass+lat+relevel(type, "Land_bridge"), data=island) summary(model 4 a) Estimate (Intercept) mass lat relevel(type, Land_bridge)Continental relevel(type, Land_bridge)Oceanic Std. Error 0. 95951 -0. 2402 -0. 01864 0. 217501 0. 151989 T value 0. 148951 0. 035362 0. 003677 0. 108051 0. 080072 t 6. 442 -6. 793 -5. 068 2. 013 1. 898 Pr(>|t|) 1. 16 E-08 2. 66 E-09 3. 00 E-06 0. 0479 0. 0617 *** *** *. : זהים נשארו הכללי המודל שהפרמטרים לב שימו Residual standard error: 0. 2771 on 72 degrees of freedom (242 observations deleted due to missingness) Multiple R-squared: 0. 478, Adjusted R-squared: 0. 449 F-statistic: 16. 48 on 4 and 72 DF, p-value: 1. 25 e-09

 המתאים המבחן בחירת : ( מתקיימות residuals- ה של נורמלית התפלגות , דומה

המתאים המבחן בחירת : ( מתקיימות residuals- ה של נורמלית התפלגות , דומה פרמטריים )שונות מבחנים של הנחותיהם אם Predictor Response test In R Categorical Success/failure Binomial** binom. test Categorical Counts Chi-square/G chisq. test Categorical continuous ANOVA* aov continuous Regression/correlation lm continuous Categorical/counts Chi-square/ANOVA lm Categorical, multiple predictors continuous Multi-way ANOVA aov continuous, multiple predictors continuous Multiple regression lm ANCOVA lm Both categorical & continuous predictors *t-test if there are only 2 categories ** or logistic regression: https: //www. youtube. com/watch? v=Eocj. YP 5 h 0 c. E

Model selection Akaike Information Criterion Hirotsugu Akaike AIC = 2 k-2 ln(L) ככל יותר

Model selection Akaike Information Criterion Hirotsugu Akaike AIC = 2 k-2 ln(L) ככל יותר חזקה במודל שהתמיכה לב שימו : יותר נמוך AIC ה שערך AIC rewards descriptive accuracy via the maximum likelihood (High L), and penalizes lack of parsimony according to the number of free parameters (high K) : מאוד פשוטה AIC לפי מודלים השוואת R- ב AIC(model 1, model 2, model 3)

Model selection: variation on the AIC theme AICc = AIC+(2 k*[k+1]/[n-k-1]) AICc. 1 קטנים

Model selection: variation on the AIC theme AICc = AIC+(2 k*[k+1]/[n-k-1]) AICc. 1 קטנים מדגמים עבור AIC ל תיקון (http: //cran. r-project. org/web/packages/AICcmodavg. pdf R )חבילת AIC weights. 2 “Akaike weights are used in model averaging. They represent the relative likelihood of a model. To calculate them, for each model first calculate the relative likelihood of the model, which is just exp(-0. 5 * ∆AIC score for that model). The Akaike weight for a model is this value divided by the sum of these values across all models. ” † Baysian Information Criterion, BIC. 3 גדולים למספרים AIC מ 1 פחות סובלני †† פרמטרים של BIC: -2*ln L + k*ln(n) † http: //www. brianomeara. info/tutorials/aic Aho et al. 2014. Model selection for ecologists: the worldviews of AIC and BIC. Ecology, 95: 631 -636. †† Wagenmakers & Farrell 2004 משחק לא המדגם גודל AIC- ב , ! המדגם בגודל מוכפל k : לב שימו . 1

: עבודה בכל , זיכרו "No statistical procedure can substitute for serious thinking about

: עבודה בכל , זיכרו "No statistical procedure can substitute for serious thinking about alternative evolutionary scenarios and their credibility" Westoby, Leishman & Lord 1995. On misinterpreting 'phylogenetic correction. J. of Ecology 83: 531 -534.