pacman::p_load(
  rio,
  janitor,
  here,
  ggplot2,
  tidyverse,
  broom, 
  performance
)

library(survival)


df <- import(here("Lepto_Sushma.csv")) %>% clean_names()

colnames(df)

view(df)


# models ------------------------------------------------------------------

model_1 <-  
  clogit(x3_case_or_control ~ sex+
           urban_rural +
           animal_contact_new +
           heavy_rainfall_in_past_one_month +
           sewage_dirty_water_contact +
           house_new +
           open_defecation +
           history_of_consumption_of_untreated_water +
           strata (registration_id), data = df)

summary(model_1)


glance(model_1)

r2_nagelkerke(model_1)


### checkig urban people with Cattle shed


table(df$urban_rural, df$cattleshed)
