MANOVA with Repeated Measures

Hi all,

I'm trying to finish up my thesis and everything has come to a halt due to my lack of experience/knowledge of biostatistics.
I am trying to see if there are any microhabitat variables that can indicate tick presence. So the site variables are the independent data and the number of ticks collected is the dependent data.
I'm struggling with creating a MANOVA with repeated measures in time. I collected ticks at 18 sites over 10 weeks and measured canopy cover, temperature etc each time I visited. The vegetation types were also classified, so open/sparse/moderate/dense herbaceous layer, sapling/pole/mature trees etc.

Any help is sincerely appreciated!

Blockquote

#Victoria Amblyomma americanum microhabitat
#Manova attempt
#based off Ende8_1

Load necessary libraries

library(ggplot2)
library(car)
library(nlme)

Read in data set

AAdata <- read.table(header=T,colClasses=c("factor","factor","factor","factor","factor","factor","factor","factor",rep("numeric",10), rep("numeric",10), rep("numeric",10), rep("numeric",10), rep("numeric",10)),text="
Site canopytype treesize shrubdensity herbdensity leaflit soilmoist Invasives temp1 temp2 temp3 temp4 temp5 temp6 temp7 temp8 temp9 temp10 humid1 humid2 humid3 humid4 humid5 humid6 humid7 humid8 humid9 humid10 wind1 wind2 wind3 wind4 wind5 wind6 wind7 wind8 wind9 wind10 canopy1 canopy2 canopy3 canopy4 canopy5 canopy6 canopy7 canopy8 canopy9 canopy10 AAticks1 AAticks2 AAticks3 AAticks4 AAticks5 AAticks6 AAticks7 AAticks8 AAticks9 AAticks10
LEOR DECID MP SMOD HDENSE LMIXED MMOD Y 77.5 83.6 81.4 85.8 97.8 88.4 79.8 76.4 82.3 68.2 64.8 61.2 48.8 76.7 60.9 44.4 74.6 57.1 51.6 40.6 3.2 3.3 1.6 1.6 2.4 1.4 2.1 2.9 2.8 4 63.7 80.1 75.2 82.6 76.5 72.5 75.2 74.7 74.2 72.71 2 7 3 7 2 1 0 0 0 0
GDDEER DECID MP SDENSE HDENSE LDECID MDRY Y 85.4 90.5 83.2 95 99.1 95.5 89.9 84.2 93.5 67.9 53.7 59.1 35.4 58 61.3 42.3 52.4 48.7 39.4 39.9 4.5 7.3 3.1 1.8 2.4 2.2 3.8 1.9 5.2 3.1 44.9 42.2 40.8 45.8 40.5 36.3 33.8 35.8 38.0 23.4 0 0 0 1 0 0 0 0 0 0
LILGRD DECID PO SMOD HSPARSE LMIXED MMOD N 81.5 78.4 78.6 95.2 84.7 83.2 84.1 82.8 84.1 63.1 54.8 78.4 57.7 61.6 73.2 56.5 52.3 67.3 57.9 47 0 0.3 0.7 0.8 1.8 0.5 0.8 0.8 1.2 2.6 90.8 92.2 94.6 92.4 95.3 91.6 91.8 93.8 95.1 91.5 0 3 2 1 0 0 0 0 0 0
STNFRT DECID MS SDENSE HMOD LDECID MMOD Y 71 86.9 88.4 88.3 86.2 81.3 88.3 94.1 88.9 63.2 49.7 69.3 47.8 65.2 68.1 78.1 69.4 64.1 58.9 53.8 0 2.1 1.5 1.2 2.1 0.9 1.1 0.8 0.8 2.3 63.4 73.2 69.7 70.1 70.5 75.1 76.1 68.6 68.9 63.2 0 0 0 0 0 0 0 0 0 0
COWLD MIXED MP SMOD HSPARSE LMIXED MMOD Y 70 86.3 79.3 89.8 89.9 80.2 90.5 90.6 89.5 64.7 58.7 76.2 65.7 59.3 45 74.9 64.1 62.8 57.1 54.5 0.9 0.9 0 0.8 0.8 0.8 1.3 0.8 0 2.9 74.2 82.4 68.1 65.9 60.9 64.1 61.0 67.9 62.5 58.5 4 5 1 14 0 0 2 1 0 0
LEGYPT DECID MP SDENSE HMOD LDECID MMOD Y 73.5 87.6 80.4 87.7 91.8 79.7 84.8 86.4 76.7 63.8 54.3 56.7 63.5 59.9 78.2 68.3 65.6 63.7 54.9 44.6 1.1 5.2 0 1.1 5.2 1.4 3.9 0.9 0.8 2.4 79.6 71.7 80.1 71.1 67.0 61.6 70.5 70.3 71.1 72.5 7 10 7 26 5 6 1 12 3 0
GDGODS MIXED MSP SMOD HMOD LMIXED MMOD Y 82.4 91 83.1 86.2 92 85.4 83.9 80.6 88.3 59.9 55.6 61.6 52.2 68.5 69.3 63.2 68.7 59.9 46.2 55.6 2.1 5.1 1 0.9 0.8 1 0.8 3.7 4.2 3.6 69.8 66.8 70.2 67.2 69.5 68.0 69.6 68.8 69.2 68.1 20 8 21 8 40 16 7 1 0 0
HRSCMP DECID MP SSPARSE HSPARSE LDECID MMOIST Y 72 84.8 72 87.8 85.2 86.3 91.3 83.1 90.5 69.9 52 68.3 67.2 71.3 68.8 71.8 56.5 70.9 63.6 61.6 1.3 0.1 0.8 0 2.1 1.1 1.3 1.6 1.3 0.8 84.8 93.4 95.1 92.8 93.7 92.1 92.1 92.6 93.3 86.5 0 2 1 1 0 0 0 0 0 0
FTYSVN DECID OP SOPEN HDENSE LDECID MMOD Y 73.7 78.3 83.3 87.8 85.1 84.4 80.3 93.5 92.4 66.7 53.7 61.7 64.8 60 74.5 80.1 64.9 72.6 48.8 54.2 1 1.8 1.8 1.5 1.9 1.7 0.7 0.7 0.8 0.9 80.0 62.5 48.1 49.2 51.1 47.5 48.1 49.4 49.0 38.3 1 7 7 2 1 0 0 0 0 0
FCLIFF DECID M SMOD HSPARSE LDECID MMOD Y 74 86.2 76.4 86.9 86.5 85.1 88.2 87.4 89.7 67.1 53.8 62.3 63.6 69.2 78.8 62.6 73.8 60.8 46.3 69.7 1.8 4.2 1.2 0 1.2 1.1 2.3 2.1 0 0.9 97.6 98.1 97.1 98.6 98.1 96.5 96.3 97.7 98.4 87.0 5 36 7 13 2 0 2 0 0 0
BELLSP MIXED MP SSPARSE HMOD LMIXED MMOD Y 74.8 79.1 78.8 88.6 77.4 83.2 78.8 83.6 78.3 60.8 60 67.3 74.3 67.2 79.6 73.2 76.2 63.2 61.8 73.6 1.8 0 1.5 0.9 0.7 0.2 0 0 0 2.1 97.1 97.1 95.8 98.0 97.7 97.6 97.8 97.8 98.3 95.2 4 8 0 1 0 0 0 0 0 0
LIMEKN DECID MP SMOD HDENSE LDECID MMOD Y 77 81.8 80.3 91.2 83.1 84.6 79.5 86.2 79.8 65.3 65 73.6 68.7 64.5 59.3 66.4 75.8 72.4 69.3 70.8 0.9 1.5 1.3 0 3.3 0 1.3 0 1.9 1.3 96.6 97.4 96.5 97.0 97.8 95.6 94.5 93.3 93.6 79.9 4 9 1 4 0 0 0 0 0 0
WHOOP DECID MP SMOD HDENSE LDECID MMOIST Y 84.5 86.1 79.8 94.9 89.4 87.8 86.4 81.3 90.6 62.1 52.8 71.2 65.6 62.1 73.7 54.3 60.3 52.3 47.9 43.2 1.9 4.1 1.3 1.7 1.3 1.3 0.8 2.4 3.4 1.3 74.2 68.5 67.3 69.2 66.3 60.4 70.9 67.9 66.5 53.4 38 37 17 42 0 2 0 0 0 0
GRVINE DECID MPS SMOD HDENSE LDECID MMOIST Y 76.5 77 79.2 98.6 87.6 88.9 83.6 86.8 88.7 68.2 50.1 82.1 57.2 65.3 71.4 76.8 63.2 70.7 59.8 62.4 1 0.9 0.6 0 0.8 1.6 0.8 0.9 0.8 0 87.1 83.9 85.1 83.1 87.4 83.8 84.4 80.3 81.9 74.7 4 15 10 4 2 5 2 0 1 0
CCREEK DECID MPS SSPARSE HSPARSE LDECID MMOD Y 74.3 82.6 83.6 87.2 88.3 90.4 85.8 87.5 90.1 66.8 44 71.2 57.2 67.8 77.8 67.1 60.3 72.3 52.1 61.8 0.8 1.2 1.1 1.2 1.8 0.8 1.3 1.1 0.8 1.2 97.2 98.3 94.3 97.2 95.7 95.3 96.5 98.3 98.7 95.8 0 5 12 15 1 3 6 1 0 0
HERONP DECID MPS SMOD HMOD LMIXED MMOD Y 77.5 86.7 84.2 90.1 84.6 81.8 88.5 92.6 89.2 72.7 52.9 61.5 52.3 56.2 80.2 64.9 72.5 65.4 52.6 63.7 0.9 1.1 0.7 0 1.2 1.4 0.8 0 0.9 0 94.5 97.0 97.7 98.2 97.9 97.7 98.5 98.9 98.2 81.9 0 13 5 3 5 2 1 0 0 0
DIXON MIXED MPS SMOD HMOD LMIXED MMOD Y 76.1 82.6 83.5 92.3 83.6 88.1 85.2 88.9 83.9 66.1 50.1 64.1 54.2 62.6 82.2 61.2 70.8 64.7 51.3 66.2 1.1 1.1 1.1 0 0.8 1.6 1.3 0.9 3.9 0 84.5 84.5 83.3 76.9 81.0 79.8 84.8 84.3 79.8 77.0 0 9 8 7 2 2 1 1 0 0
FRTMAS DECID MP SMOD HMOD LMIXED MMOD Y 88 87.9 78.1 98.2 85.4 85.6 93.6 88.9 89.9 66.9 41.3 62.3 57.9 68.8 75.1 68.5 63.2 58.8 50.4 65.8 0.8 2.1 1.1 0 1.1 1.1 1.6 1.1 0.9 0 94.6 96.3 95.3 92.6 95.3 85.5 92.0 91.6 91.4 91.2 21 58 22 26 15 12 4 3 6 0
")

Print original data

AAdata

Rearrange data into split-plot form

TempAAplot <- reshape(AAdata,list(9:18, 49:58),idvar="Site",timevar=c("temp","AAticks"),v.names=c("temperature","Aaticks"),
direction="long")
HumidAAplot <- reshape(AAdata,list(19:28, 49:58),idvar="Site",timevar=c("humid","AAticks"),v.names=c("humidity","Aaticks"),
direction="long")
WindAAplot <- reshape(AAdata,list(29:38, 49:58),idvar="Site",timevar=c("wind","AAticks"),v.names=c("Wind","Aaticks"),
direction="long")
CanopyAAplot <- reshape(AAdata,list(39:48, 49:58),idvar="Site",timevar=c("canopy","AAticks"),v.names=c("Canopycover","Aaticks"),
direction="long")
#my attempt to combine variables

Tempvar <- (cbind("temp1","temp2","temp3","temp4","temp5","temp6","temp7","temp8","temp9","temp10"))
Humidvar <- (cbind("humid1","humid2","humid3","humid4","humid5","humid6","humid7","humid8","humid9","humid10"))
Windvar <- (cbind("wind1","wind2","wind3","wind4","wind5","wind6","wind7","wind8","wind9","wind10"))
Canopyvar <- (cbind("canopy1","canopy2","canopy3","canopy4","canopy5","canopy6","canopy7","canopy8","canopy9","canopy10"))

Ticks <- (cbind("AAticks1","AAticks2","AAticks3","AAticks4","AAticks5","AAticks6","AAticks7","AAticks8","AAticks9","AAticks10"))

Allrepvar <- (cbind(Tempvar,Humidvar,Windvar,Canopyvar))

Allvar <- (cbind("canopytype","treesize","shrubdensity","herbdensity","leaflit","soilmoist","Invasives",Allrepvar))

#Attempt Test for Profile analysis MANOVA temp against ticks
tempdata <- data.frame(temp=ordered(c("temp1","temp2","temp3","temp4","temp5","temp6","temp7","temp8","temp9","temp10")))
AAtickdata <- data.frame(AAticks=ordered(c("AAticks1","AAticks2","AAticks3","AAticks4","AAticks5","AAticks6","AAticks7","AAticks8","AAticks9","AAticks10")))
profout <- lm(cbind(temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8,temp9,temp10)~cbind(AAticks1,AAticks2,AAticks3,AAticks4,AAticks5,AAticks6,AAticks7,AAticks8,AAticks9,AAticks10),data=AAdata)
Aovout <- Anova(profout,tempdata=tempdata,idesign=~temp)
summary(Aovout)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.