cchanialidis / combayes

Bayesian COM-Poisson regression for count data
0 stars 0 forks source link

Cannot run example program "Application 1: Fertility data" #9

Closed omsai closed 4 years ago

omsai commented 5 years ago

The Fertility data example fails because, the data source now has 9 columns instead of 10.

# Load data from library Countr
library(Countr)
data(fertility)
# Standardise all non-binary covariates
fertility[,c(2,9,10)] <- scale(fertility[,c(2,9,10)],center=TRUE,scale=TRUE)
...
Error in `[.data.frame`(fertility, , c(2, 9, 10)) :                          
  undefined columns selected 
> dim(fertility)
[1] 1243    9
> head(fertility)
  children german years_school voc_train university religion year_birth rural
1        2     no            8        no         no Catholic         42   yes
2        3     no            8        no         no Catholic         55   yes
3        2     no            8        no         no Catholic         51   yes
4        4     no            8        no         no Catholic         54    no
5        2     no            8        no         no Catholic         46   yes
6        2     no            8        no         no Catholic         41    no
  age_marriage
1           20
2           21
3           24
4           26
5           22
6 
>
cchanialidis commented 4 years ago

I had to remove the data set (due to some issues with the categorical covariates). I will try to upload another data set (with similar levels of dispersion) soon.