Displaying 1 result from an estimated 1 matches for "siteeffect".
Did you mean:
sideeffect
2011 Apr 28
1
Coding design with repeated measurements in the survey package
...Year + (Design$YearInCycle - 1) * nSitePerYear
#plot the design
#points indicate in which year a site is sampled
#lines connect the sites
library(ggplot2)
ggplot(Design, aes(x = Year, y = Site, group = Site)) + geom_point() + geom_line()
#create some dummy data
Intercept <- 10
Trend <- -0.25
SiteEffect <- rnorm(nSitePerYear * nYearPerCycle, sd = 2)
Design$Y <- Intercept + Trend * Design$Year + SiteEffect[Design$Site] + rnorm(nrow(Design), sd = 1)
ggplot(Design, aes(x = Year, y = Y)) + geom_point() + geom_line(aes(group = Site))
#my attempt of coding the design
library(survey)
Design$fpc &l...