I have binary dataset consisting of 15 zeros and 40 ones. To address potential bias in my data, I have calculated the probability of success from each cell by fitting a glm with binomial family as follows:
# Fit a generalized linear model (GLM) with binomial family
model <- glm(predation ~ treatment, data = data, family = binomial())
# Extract the fitted probabilities of success
fitted_probs <- predict(model, type = "response")
Then, I generated a new random data sample based on these probabilities and extracted the modified variable:
modified_variable <- rbinom(length(fitted_probs), 1, fitted_probs)
My question is: Does it make sense to use this new resampled data in regression or chi-square tests?
Any references or resources related to this topic would be highly appreciated.