In the early 1990s Khongsak Pinyopusarerk of CSIRO Forestry and Forest Products initiated a far-reaching study of Casuarina equisetifolia. This is a nitrogen-fixing tree of considerable social, economic and environmental importance in tropical/subtropical littoral zones of Asia, the Pacific and Africa. Provenance collections were obtained from 18 countries and, with this material, more than 40 trials were laid out in 20 countries. The number of seedlots included in each trial varied, depending on the suitability and size of the planting sites for the available material. One of the trials, in Weipa, northern Queensland, contained all the available seedlots and is the example used here.
library(car)library(dae)library(dplyr)library(emmeans)library(ggplot2)library(lmerTest)library(magrittr)library(predictmeans)data(DataExam8.1)# Pg. 141 fm8.4<-aov(formula = dbh ~ inoc +Error(repl/inoc) + inoc*country*prov , data = DataExam8.1 )# Pg. 150summary(fm8.4)Error: repl Df Sum Sq Mean Sq F value Pr(>F) inoc 111.54211.54211.460.0773 .Residuals 22.0141.007---Signif. codes:0'***'0.001'**'0.01'*'0.05'.'0.1' '1Error: Within Df Sum Sq Mean Sq F value Pr(>F) country 1754.623.2135.3050.0000000159***prov 4118.610.4540.7490.854inoc:country 1710.070.5920.9780.487inoc:prov 4121.460.5230.8640.698Residuals 11670.260.606---Signif. codes:0'***'0.001'**'0.01'*'0.05'.'0.1' '1# Pg. 150model.tables(x = fm8.4, type ="means")Tables of meansGrand mean3.40411 inoc 7 weeks 1 week3.6253.183rep 118.000118.000 country India Vietnam Egypt Kenya Fiji Thailand Malaysia Philippines Australia3.5753.2762.4983.4912.6123.8414.0313.6122.631rep 24.00020.00012.00032.00012.00016.00036.00012.00016.000 PNG Solomon Is. Mauritius Sri Lanka Guam China Puerto Rico Vanuatu Benin3.653.6993.1223.2432.3423.6863.3452.7623.342rep 4.008.0004.00012.0004.00012.0004.0004.0004.000 prov 1234567810111213142.6234.0133.713.273.4043.0933.7013.5413.3713.3013.183.373.404rep 4.0004.0004.004.004.0004.0004.0004.0004.0004.0004.004.004.000151617181920212223242526273.5953.433.2753.0853.663.3823.2353.463.083.5553.9183.6483.43rep 4.0004.004.0004.0004.004.0004.0004.004.004.0004.0004.0004.00282930313233343536373839402.9053.7083.1963.7613.4163.1782.9583.6363.3763.4043.2523.153.81rep 4.0004.0004.0004.0004.0004.0004.0004.0004.0004.0004.0004.004.00414245464748505152535455563.1953.6133.5182.763.7333.6053.4043.6853.2353.7553.6052.743.662rep 4.0004.0004.0004.004.0004.0004.0004.0004.0004.0004.0004.004.000575859606162633.4083.4043.4043.5283.1783.5063.418rep 4.0004.0004.0004.0004.0004.0004.000 inoc:country countryinoc India Vietnam Egypt Kenya Fiji Thailand Malaysia Philippines7 weeks 3.6723.4432.7473.6092.9553.6114.5023.558 rep 12.00010.0006.00016.0006.0008.00018.0006.0001 week 3.4773.1102.2503.3732.2684.0713.5593.665 rep 12.00010.0006.00016.0006.0008.00018.0006.000 countryinoc Australia PNG Solomon Is. Mauritius Sri Lanka Guam China 7 weeks 2.9593.8504.2003.3903.6952.2454.030 rep 8.0002.0004.0002.0006.0002.0006.0001 week 2.3043.4503.1972.8552.7922.4403.342 rep 8.0002.0004.0002.0006.0002.0006.000 countryinoc Puerto Rico Vanuatu Benin 7 weeks 3.5402.7203.870 rep 2.0002.0002.0001 week 3.1502.8052.815 rep 2.0002.0002.000 inoc:prov provinoc 123456781011127 weeks 2.4274.6823.7573.6373.6253.5404.1003.7743.5593.5443.135 rep 2.0002.8193.3443.6642.9043.1832.6463.3013.3083.1833.0581 week 2.8193.3443.6642.9043.1832.6463.3013.3083.1833.0583.225 rep 2.4274.6823.7573.6373.6253.5404.1003.7743.5593.5443.135 provinoc 13141516171819202122237 weeks 3.8453.6254.1044.1193.6043.1143.5093.3043.5913.8013.276 rep 3.2252.8953.1833.0852.7402.9453.0553.8103.4602.8803.1201 week 2.8953.1833.0852.7402.9453.0553.8103.4602.8803.1202.885 rep 3.8453.6254.1044.1193.6043.1143.5093.3043.5913.8013.276 provinoc 24252627282930313233347 weeks 3.0213.9764.2864.1862.8663.6632.9883.7934.3583.3433.468 rep 2.8854.0903.8603.0102.6752.9453.7543.4043.7292.4743.0141 week 4.0903.8603.0102.6752.9453.7543.4043.7292.4743.0142.449 rep 3.0213.9764.2864.1862.8663.6632.9883.7934.3583.3433.468 provinoc 35363738394041424546477 weeks 3.8483.6883.6253.7723.1323.9723.5453.7053.4392.5994.119 rep 2.4493.4243.0643.1832.7333.1683.6482.8453.5203.5972.9221 week 3.4243.0643.1832.7333.1683.6482.8453.5203.5972.9223.347 rep 3.8483.6883.6253.7723.1323.9723.5453.7053.4392.5994.119 provinoc 48505152535455565758597 weeks 4.3443.6254.1374.1524.0473.1672.6223.8953.4783.6253.625 rep 3.3472.8673.1833.2332.3183.4634.0432.8583.4303.3393.1831 week 2.8673.1833.2332.3183.4634.0432.8583.4303.3393.1833.183 rep 4.3443.6254.1374.1524.0473.1672.6223.8953.4783.6253.625 provinoc 606162637 weeks 3.6853.6303.5603.235 rep 3.1833.3712.7263.4511 week 3.3712.7263.4513.601 rep 3.6853.6303.5603.235 RESFit <-data.frame(fittedvalue =fitted.aovlist(fm8.4) , residualvalue =proj(fm8.4)$Within[,"Residuals"] )ggplot(data = RESFit , mapping =aes(x = fittedvalue, y = residualvalue) ) +geom_point(size =2) +labs(x ="Residuals vs Fitted Values" , y ="" ) +theme_bw()
# Pg. 153 fm8.6<-aov(formula =terms( dbh ~ inoc + repl + col + repl:row + repl:col + prov + inoc:prov , keep.order =TRUE ) , data = DataExam8.1 )summary(fm8.6) Df Sum Sq Mean Sq F value Pr(>F) inoc 111.5411.54248.0540.00000000327***repl 22.011.0074.1930.019746*col 965.247.24930.182<0.0000000000000002***repl:row 2016.590.8303.4540.000105***repl:col 2716.410.6082.5300.001443**prov 5853.890.9293.8690.00000026687***inoc:prov 588.470.1460.6080.970544Residuals 6014.410.240---Signif. codes:0'***'0.001'**'0.01'*'0.05'.'0.1' '1
8.2 Example 8.1 (continued) (Pg. 147)
Example 8.1 (continued) (Pg. 147)
library(car)library(dae)library(dplyr)library(emmeans)library(ggplot2)library(lmerTest)library(magrittr)library(predictmeans)data(DataExam8.1)# Pg. 155 fm8.8<- lmerTest::lmer(formula = dbh ~1+ repl + col + prov + (1|repl:row) + (1|repl:col) , data = DataExam8.1 , REML =TRUE )# Pg. 157#\dontrun{varcomp(fm8.8) vcov SE 2.5% 97.5 %repl:col.(Intercept) 0.04590.02620.00000.0565repl:row.(Intercept) 0.06400.02940.02100.1161residual 0.19510.02530.11260.1782#}anova(fm8.8)Type III Analysis of Variance Table with Satterthwaite's method Sum Sq Mean Sq NumDF DenDF F value Pr(>F) repl 2.581 0.86023 3 21.257 4.4082 0.01469 * col 24.874 2.76378 9 23.705 14.1627 0.00000015112494790 ***prov 55.433 0.95574 58 136.623 4.8976 0.00000000000001306 ***---Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 '' 1 anova(fm8.8, ddf = "Kenward-Roger")Type III Analysis of Variance Table with Kenward-Roger's method Sum Sq Mean Sq NumDF DenDF F value Pr(>F) repl 2.5800.86016322.6224.40780.0139*col 24.8242.75827922.94714.13370.0000002097637857***prov 54.7950.9447358133.8524.83960.0000000000000283***---Signif. codes:0'***'0.001'**'0.01'*'0.05'.'0.1' '1predictmeans(model = fm8.8, modelterm ="repl")
$`Predicted Means`repl12343.75433.12693.21283.5023$`Standard Error of Means`All means have the same SE 0.13629$`Standard Error of Differences` Max.SED Min.SED Aveg.SED 0.19274950.19274230.1927472$LSD Max.LSD Min.LSD Aveg.LSD 0.399100.399090.39910attr(,"Significant level")[1] 0.05attr(,"Degree of freedom")[1] 22.62$mean_table repl Mean SE Df LL(95%) UL(95%)113.75430.1362922.62143.47214.0365223.12690.1362922.62142.84473.4091333.21280.1362922.62142.93063.4950443.50230.1362922.62143.22013.7845predictmeans(model = fm8.8, modelterm ="col")
$`Predicted Means`col123456789103.50533.49963.85093.82803.59473.78293.30593.51583.17761.9301$`Standard Error of Means`col123456789100.154960.156490.154930.154940.154900.157210.154790.156990.154850.15648$`Standard Error of Differences` Max.SED Min.SED Aveg.SED 0.21322950.20612230.2086161$LSD Max.LSD Min.LSD Aveg.LSD 0.437420.422840.42796attr(,"Significant level")[1] 0.05attr(,"Degree of freedom")[1] 27.12$mean_table col Mean SE Df LL(95%) UL(95%)113.50530.1549627.117363.18743.8232223.49960.1564927.117363.17863.8207333.85090.1549327.117363.53304.1687443.82800.1549427.117363.51014.1458553.59470.1549027.117363.27693.9125663.78290.1572127.117363.46044.1054773.30590.1547927.117362.98833.6234883.51580.1569927.117363.19383.8379993.17760.1548527.117362.85993.495210101.93010.1564827.117361.60912.2511predictmeans(model = fm8.8, modelterm ="prov")
$`Predicted Means`prov123456781011122.42223.14252.86462.25993.71893.54453.94742.74692.64592.04972.749713141516171819202122232.98332.65343.44593.92093.42943.36243.65403.36853.22103.33153.245324252627282930313233343.69333.84603.52333.52713.10013.89973.54474.12944.27553.74293.889035363738394041424546474.11793.85263.45383.03793.53063.74123.74223.87654.21263.46604.468848505152535455565758593.75032.55713.45713.32273.59263.53372.71572.77023.98052.99683.3978606162633.01153.22383.28143.5751$`Standard Error of Means`prov1234567810110.253620.254460.252780.254430.254230.255880.254200.253380.254170.25259121314151617181920210.253060.254360.252590.252320.255020.253190.253400.253090.252940.25204222324252627282930310.253500.253550.253580.253160.252890.252940.252910.253410.252540.25330323334353637383940410.253770.253870.255100.253470.253510.253520.254160.253930.254500.25416424546474850515253540.253030.252570.253230.253160.253560.253540.253720.253610.252370.253215556575859606162630.253740.256390.251730.253190.252500.253030.253780.252660.25500$`Standard Error of Differences` Max.SED Min.SED Aveg.SED 0.35917120.33267190.3482665$LSD Max.LSD Min.LSD Aveg.LSD 0.709240.656910.68770attr(,"Significant level")[1] 0.05attr(,"Degree of freedom")[1] 162.73$mean_table prov Mean SE Df LL(95%) UL(95%)112.42220.25362162.72691.92142.9230223.14250.25446162.72692.64013.6450332.86460.25278162.72692.36553.3638442.25990.25443162.72691.75752.7623553.71890.25423162.72693.21694.2209663.54450.25588162.72693.03924.0498773.94740.25420162.72693.44544.4493882.74690.25338162.72692.24663.24739102.64590.25417162.72692.14403.147810112.04970.25259162.72691.55092.548511122.74970.25306162.72692.25003.249412132.98330.25436162.72692.48103.485513142.65340.25259162.72692.15463.152214153.44590.25232162.72692.94763.944115163.92090.25502162.72693.41734.424516173.42940.25319162.72692.92943.929317183.36240.25340162.72692.86203.862818193.65400.25309162.72693.15434.153819203.36850.25294162.72692.86903.868020213.22100.25204162.72692.72343.718721223.33150.25350162.72692.83103.832122233.24530.25355162.72692.74473.746023243.69330.25358162.72693.19264.194124253.84600.25316162.72693.34614.345925263.52330.25289162.72693.02394.022726273.52710.25294162.72693.02764.026527283.10010.25291162.72692.60073.599628293.89970.25341162.72693.39934.400129303.54470.25254162.72693.04604.043430314.12940.25330162.72693.62934.629631324.27550.25377162.72693.77444.776632333.74290.25387162.72693.24164.244233343.88900.25510162.72693.38534.392834354.11790.25347162.72693.61744.618535363.85260.25351162.72693.35204.353236373.45380.25352162.72692.95323.954437383.03790.25416162.72692.53603.539838393.53060.25393162.72693.02914.032039403.74120.25450162.72693.23864.243740413.74220.25416162.72693.24034.244041423.87650.25303162.72693.37694.376142454.21260.25257162.72693.71394.711443463.46600.25323162.72692.96603.966144474.46880.25316162.72693.96894.968745483.75030.25356162.72693.24964.251046502.55710.25354162.72692.05643.057747513.45710.25372162.72692.95613.958248523.32270.25361162.72692.82193.823549533.59260.25237162.72693.09434.091050543.53370.25321162.72693.03374.033751552.71570.25374162.72692.21463.216752562.77020.25639162.72692.26403.276553573.98050.25173162.72693.48344.477654582.99680.25319162.72692.49683.496855593.39780.25250162.72692.89923.896356603.01150.25303162.72692.51183.511257613.22380.25378162.72692.72273.725058623.28140.25266162.72692.78253.780359633.57510.25500162.72693.07164.0787# Pg. 161 RCB1 <-aov(dbh ~ prov + repl, data = DataExam8.1) RCB <-emmeans(RCB1, specs ="prov") %>%as_tibble() Mixed <-emmeans(fm8.8, specs ="prov") %>%as_tibble() table8.9<-left_join(x = RCB , y = Mixed , by ="prov" , suffix =c(".RCBD", ".Mixed") )print(table8.9)# A tibble: 59 × 11 prov emmean.RCBD SE.RCBD df.RCBD lower.CL.RCBD upper.CL.RCBD emmean.Mixed<fct><dbl><dbl><dbl><dbl><dbl><dbl>111.850.3821741.102.602.42223.240.3821742.493.993.14332.940.3821742.183.692.86442.500.3821741.743.252.26553.340.3821742.594.103.72663.370.3821742.624.133.54773.980.3821743.234.743.95882.630.3821741.883.392.759102.470.3821741.713.222.6510112.400.3821741.643.152.05# ℹ 49 more rows# ℹ 4 more variables: SE.Mixed <dbl>, df.Mixed <dbl>, lower.CL.Mixed <dbl>,# upper.CL.Mixed <dbl>
8.3 Example 8.1 (continued) (Pg. 155)
Example 8.1 (continued) (Pg. 155)
library(car)library(dae)library(dplyr)library(emmeans)library(ggplot2)library(lmerTest)library(magrittr)library(predictmeans)data(DataExam8.1)# Pg. 167 fm8.11<-aov(formula = dbh ~ country + country:prov , data = DataExam8.1 ) b <-anova(fm8.11) Res <-length(b[["Sum Sq"]]) df <-119 MSS <-0.1951 b[["Df"]][Res] <- df b[["Sum Sq"]][Res] <- MSS*df b[["Mean Sq"]][Res] <- b[["Sum Sq"]][Res]/b[["Df"]][Res] b[["F value"]][1:Res-1] <- b[["Mean Sq"]][1:Res-1]/b[["Mean Sq"]][Res] b[["Pr(>F)"]][Res-1] <-df( b[["F value"]][Res-1] , b[["Df"]][Res-1] , b[["Df"]][Res] ) bAnalysis of Variance TableResponse: dbh Df Sum Sq Mean Sq F value Pr(>F) country 1754.6193.212916.4680.00000001235***country:prov 4118.6060.45382.3260.001502**Residuals 11923.2170.1951---Signif. codes:0'***'0.001'**'0.01'*'0.05'.'0.1' '1emmeans(fm8.11, specs ="country") country emmean SE df lower.CL upper.CL India 3.570.1651773.253.90 Vietnam 3.280.1811772.923.63 Egypt 2.500.2331772.042.96 Kenya 3.490.1431773.213.77 Fiji 2.610.2331772.153.07 Thailand 3.840.2021773.444.24 Malaysia 4.030.1351773.774.30 Philippines 3.610.2331773.154.07 Australia 2.630.2021772.233.03 PNG 3.650.4041772.854.45 Solomon Is. 3.700.2851773.144.26 Mauritius 3.120.4041772.333.92 Sri Lanka 3.240.2331772.783.70 Guam 2.340.4041771.553.14 China 3.690.2331773.234.15 Puerto Rico 3.350.4041772.554.14 Vanuatu 2.760.4041771.973.56 Benin 3.340.4041772.554.14Results are averaged over the levels of: prov Confidence level used:0.95
8.4 Example 8.2 (Pg. 157)
Example 8.2 (Pg. 157)
In Example 7.1 we discussed a Eucalyptus clone trial conducted in Vietnam and described the experimental layout. The trial tested 56 hybrid clones of the interspecific hybrid combination E. urophylla\(\times\)E. pellita (UP). These candidates had been selected from progeny trials of control-pollinated hybrid families; here we ignore the parental origins of the different UP clones.
$`Predicted Means`repl123457.89268.20708.34298.46048.5464$`Standard Error of Means`repl123450.331230.331260.329920.329920.32992$`Standard Error of Differences` Max.SED Min.SED Aveg.SED 0.22396750.21673200.2196681$LSD Max.LSD Min.LSD Aveg.LSD 0.447920.433450.43932attr(,"Significant level")[1] 0.05attr(,"Degree of freedom")[1] 60.56$mean_table repl Mean SE Df LL(95%) UL(95%)117.89260.3312360.558927.23028.5551228.20700.3312660.558927.54458.8695338.34290.3299260.558927.68319.0027448.46040.3299260.558927.80069.1202558.54640.3299260.558927.88669.2062predictmeans(model = fm8.2, modelterm ="column")
$`Predicted Means`column1234568.22148.47088.37797.97217.81668.7141$`Standard Error of Means`column1234560.316620.391680.393150.266480.266460.31653$`Standard Error of Differences` Max.SED Min.SED Aveg.SED 0.27147600.21025830.2373610$LSD Max.LSD Min.LSD Aveg.LSD 0.542500.420170.47433attr(,"Significant level")[1] 0.05attr(,"Degree of freedom")[1] 62.99$mean_table column Mean SE Df LL(95%) UL(95%)118.22140.3166262.994377.58878.8542228.47080.3916862.994377.68819.2535338.37790.3931562.994377.59239.1636447.97210.2664862.994377.43968.5047557.81660.2664662.994377.28418.3491668.71410.3165362.994378.08169.3467emmeans(object = fm8.2, specs =~contcompf|standard)contcompf =1, standard =0: emmean SE df lower.CL upper.CL8.910.11765.98.679.14contcompf =0, standard = UG323: emmean SE df lower.CL upper.CL8.970.77055.67.4310.51contcompf =0, standard = U6: emmean SE df lower.CL upper.CL6.550.77055.55.018.10contcompf =0, standard = PN14: emmean SE df lower.CL upper.CL7.700.77155.86.169.25contcompf =0, standard = SSOseed: emmean SE df lower.CL upper.CL6.080.77055.54.547.63Results are averaged over the levels of: repl, column Degrees-of-freedom method: kenward-roger Confidence level used:0.95