I am currently using R studio, and downloaded the 'brms' package, for those who are familiar with it. I wanted to create a code which loaded a data set, ran a poisson transformation on it, and coded the transformation as a different variable:
`install.packages("brms")
library(brms)
#In this example, we have a data set which includes data for fishing,
#like number of fish caught, whether bait was used, etc.
#We will bit this using something called a 'zero limit possion' model'.
zinb <- read.csv("http://stats.idre.ucla.edu/stat/data/fish.csv") #data set
zinb$camper <- factor(zinb$camper, labels = c("no", "yes")) #adding whether camper was there
head(zinb)
is.data.frame(zinb)
summary(zinb)
#below, we fit our zinb data set into that zero limit possion model, and
#our predictors will be number of persons, whether there was a child,
#and if the group consisted of campers.
fit_zinb1=brm(data=zinb, count ~persons + child + camper,
family = zero_inflated_poisson("log")) #specify the data, and the family
#see what it looks like
summary(fit_zinb1)
However, R fails to recognize my new variable "fit_zinb1". Any thoughts as to why this might be the case?
Thank you so much!