Reputation: 23
I am interested in understanding how my variable (distance) changes over time between two treatment groups. I now want to compare measures of variance for distance between the two treatment groups, but I am unsure the best way to go about this. Based on my figures, Treatment 1 has a slope of 0 and more variance, and Treatment 2 has a positive slope but I am not sure if variance increases over time for this group. What is the best way to test this? My data looks something like this:
Treatment Distance Time
1 7 2
1 2 4
1 3 1
1 6 5
2 2 2
2 4 5
2 6 8
2 2 4
I can't take the variance of the residuals in a glmm yet, because this is preliminary analysis of a partial dataset and I don't have enough power. When I try to calculate a basic variance metric (not by time), I get NA.
var1<- var(Data$Distance[Data$Treatment == 1])
print(var1)
NA
var2<- var(Data$Distance[Data$Treatment == 2])
print(var2)
NA
Upvotes: 0
Views: 53