0
$\begingroup$

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.

$\endgroup$
6
  • 1
    $\begingroup$ Is there a reason you don't just run the regression on your original data? $\endgroup$
    – Dave
    Commented Jul 9, 2023 at 22:20
  • $\begingroup$ No, nothing in particular, though I was afraid of having complete separation. However, I noticed that the resampled data were even more biased than the original one. $\endgroup$ Commented Jul 9, 2023 at 22:45
  • 1
    $\begingroup$ What do you mean by "biased"? Note that this is a technical term in statistics with a specific meaning related to expected value. $\endgroup$
    – Dave
    Commented Jul 9, 2023 at 22:49
  • $\begingroup$ Apologies for the newbness. By biased I was referring to the lots of 1s compared to the few 0s. $\endgroup$ Commented Jul 9, 2023 at 23:04
  • 1
    $\begingroup$ Treatment consists of multiple categories, three to be exact. $\endgroup$ Commented Jul 10, 2023 at 1:51

1 Answer 1

1
$\begingroup$

Assuming you have independent, binary responses ("predation") and a single predictor variable ("treatment"), your initial code looks correct. Resampling can't help with complete separation.

$\endgroup$
6
  • $\begingroup$ May I ask under what circumstances it is advisable to resample data? Additionally, is it possible to utilize the probabilities of success themselves in modeling approaches? I would greatly appreciate any references or resources related to this topic. $\endgroup$ Commented Jul 10, 2023 at 10:59
  • 1
    $\begingroup$ 1. Resampling is typically used when bootstrapped standard errors (SEs) are sought, e.g., when estimated asymptotic SEs provide a poor approximation to the true SDs of the estimators. 2. You don't know the true probabilities of success, so you can't use them. Even if you did, they wouldn't help you here. If you have independent, binary responses, each with a probability of success that depends only on treatment, then the binomial GLM is, by definition, the true model. You don't need to consider other approaches. $\endgroup$ Commented Jul 10, 2023 at 18:48
  • $\begingroup$ The same would apply even if I have other grouping factors, say, exposing the treatments to different categorical conditions, or if I have a continuous predictor instead of a binary one? $\endgroup$ Commented Jul 10, 2023 at 19:26
  • 1
    $\begingroup$ Yes, my comments apply regardless of the nature of your predictors. $\endgroup$ Commented Jul 10, 2023 at 23:45
  • 1
    $\begingroup$ I'm not sure about Type I and II error probabilities. But, in general, for large samples, likelihood-based inferential procedures (like your original analysis) are the most powerful. You don't gain anything by resampling. Even if you have a relatively small sample in your context, the likelihood ratio test of the effect of treatment should perform well (i.e., be approximately valid and relatively powerful). $\endgroup$ Commented Jul 11, 2023 at 3:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.