Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Logistic error

    Good day, I am a fairly new stata user and looking for some assistance with a logistic error. I am conducting medical research and have a data set of 567 observations. There are 2 main groups (VAD and SSCD) and am looking at the outcomes of the 2 groups. I am attempting to do bivariate analyses before building a model for logistic regression analysis of the outcomes but keep getting the same error. Please could someone assist with problem solving for this.

    Attached Files

  • #2
    Andrew:
    Stata is telling you that there's no variation in your depenedent variable as the predictor predicts it perfectly (say, 150 observations=1 and 150 y=1).
    If there's no variation, the MLE has nothing to maximize.
    See the following toy-example:
    Code:
    . set obs 10
    Number of observations (_N) was 0, now 10.
    
    . g id=_n
    
    . g outcome=1 in 1/9
    
    . g predictor=1 in 1/9
     
    . replace outcome=0 if outcome==.
    
    . replace predictor=0 if predictor==.
    
    . logistic outcome predictor
    outcome = predictor > 0 predicts data perfectly
    r(2000);
    
    .
    In addition, the literature in yiour research field should lead you up in the specification of your regression model (simple logistic regressions are not really useful in this respect, unless the aimof your research includes a bit of exploratory analysis).
    As an aside, instead of posting screenshots, please use CODE delimiters to share what you typed and what Stata gave you back. Thanks.
    Last edited by Carlo Lazzaro; 27 Dec 2023, 03:39.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X