Created
October 7, 2019 18:04
-
-
Save monogenea/502595f8754a85b6586a2089a8d409b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tensorflow) | |
use_condaenv("greta") | |
library(greta) | |
library(tidyverse) | |
library(bayesplot) | |
library(readxl) | |
# Read female reproductive output and discard records w/ NAs | |
fro <- read_xlsx("data.xlsx", sheet = allTabs[2]) | |
fro <- fro[complete.cases(fro),] | |
# Use cross-classified varying intercepts for year, female ID and group ID | |
female_id <- as.integer(factor(fro$Female_ID_coded)) | |
year <- as.integer(factor(fro$Year)) | |
group_id <- as.integer(factor(fro$Group_ID_coded)) | |
# Define and standardize model vars | |
Age <- as_data(scale(fro$Min_age)) | |
Eggs_laid <- as_data(scale(fro$Eggs_laid)) | |
Mean_eggsize <- as_data(scale(fro$Mean_eggsize)) | |
Group_size <- as_data(scale(fro$Group_size)) | |
Parasite <- as_data(fro$Parasite) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment