Combined text file containing commands and data used for the model-based analyses of the effects of host (galler and willow species) and location on parasitism using the mvabund package in R. Host codes refer to the willow host species of each galler (e.g., SMYR = Salix myrsinifolia), location codes show the three first letters of each location, parasitoid species are denoted by six-letter abbreviations (e.g., Ptepon = Pteromalus pontaniae). Pteromalus sp.2 has been excluded from the table (= 0 in all these samples), NSEQ = number of parasitoid larvae barcoded in each community sample. The association table needs to be saved into a separate text file before the analysis. Replace XXXX/XXXX/XXXX in the commands with the path to the folder containing the data file. ************************************************************ fulldata<-read.delim("C:/XXXX/XXXX/XXXX/Parasitoid_counts.txt", header=TRUE) attach(fulldata) parabund<-mvabund(Ptepon, Ptedol, Ptesp1, Eultor, Euraci, Eursp, Eulsp1, Eulsp2, Brakop, Shalap, Ichsp2, Scaves, Adecub) NSEQ<-NSEQ plot(parabund~host, col=location) plot(parabund~location, col=host) para.nb<-manyglm(parabund~location+host, offset = log(NSEQ), family="negative.binomial") predict(para.nb, type="response") coef(para.nb) residuals(para.nb) plot(para.nb) anova(para.nb, p.uni="adjusted") meanvar.plot(parabund~location, col = host) meanvar.plot(parabund~host, col = location) meanvar.plot(parabund~host+location) ************************************************************ Parasitoid_counts.txt: host location NSEQ Ptepon Ptedol Ptesp1 Eultor Euraci Eursp Eulsp1 Eulsp2 Brakop Shalap Ichsp2 Scaves Adecub SMYR_ABI SMYR ABI 53 0 7 0 31 11 0 1 0 0 0 0 0 3 SMYR_KIL SMYR KIL 28 0 4 0 15 0 0 0 0 0 2 0 2 5 SMYR_TRO SMYR TRO 6 0 0 0 2 0 0 0 0 0 1 0 3 0 SLAN_ABI SLAN ABI 19 0 3 2 0 3 0 0 1 2 0 0 8 0 SLAN_KIL SLAN KIL 21 0 3 1 0 1 0 0 0 0 12 0 2 2 SLAN_TRO SLAN TRO 20 0 0 0 0 3 0 0 0 0 7 0 10 0 SGLA_ABI SGLA ABI 31 5 6 0 11 3 0 0 0 2 1 0 3 0 SGLA_KIL SGLA KIL 32 2 8 0 10 0 0 0 0 1 0 0 5 6 SGLA_TRO SGLA TRO 26 0 6 0 7 7 0 0 0 1 2 0 3 0 SHER_KIL SHER KIL 26 9 0 0 0 0 0 0 0 16 0 1 0 0 SPOL_KIL SPOL KIL 21 12 0 0 0 0 0 0 0 9 0 0 0 0 SHER_ABI SHER ABI 35 10 0 0 0 0 0 0 0 25 0 0 0 0 SHER_TRO SHER TRO 20 3 0 0 0 0 0 0 0 15 2 0 0 0 SPOL_ABI SPOL ABI 32 2 0 0 0 0 0 0 0 30 0 0 0 0 SPOL_TRO SPOL TRO 22 9 0 0 0 0 0 0 0 12 0 0 1 0 SRET_ABI SRET ABI 29 16 0 0 0 0 0 0 0 13 0 0 0 0 SRET_KIL SRET KIL 30 12 0 0 0 0 0 0 0 4 14 0 0 0 SRET_TRO SRET TRO 30 15 0 0 0 0 0 0 0 15 0 0 0 0 SLAP_ABI SLAP ABI 32 0 14 0 8 3 2 0 0 2 1 0 2 0 SLAP_KIL SLAP KIL 17 0 2 0 5 0 0 0 0 1 3 0 1 5 SLAP_TRO SLAP TRO 8 0 1 0 0 0 0 0 0 2 5 0 0 0 ************************************************************