#' Perform the beta regression used to demonstrate the relationship between
#' canopy cover and distance from the impoundment.
#'
#' @import betareg dplyr
#' @export
## Create LightData object by combining PlotData, containing densiometer data,
## with site type (lake versus river) data from ElevationData
CCBetaRegression <- function(){
CreateDatasets()
LightData$RegProp <- (LightData$CanopyProp *
(185 - 1) + 0.5) / (185) ## See Smithson + Verkulien 2006
LightData$LogCode <- log(LightData$PlotCode)
LightBetaReg <<- betareg(RegProp ~ LogCode + LakeRiver, data = LightData)
LightData$Predict <- predict(LightBetaReg, newdata = LightData)
LightData <<- LightData
return(LightBetaReg)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.