Announcement

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

  • an error occurred when svy executed logistic r(2000);

    Hi everyone,

    Though this is my first post, I have found answers to many of my questions here. Thank you for your good work.
    I am a beginner in stata. I am doing a logistic regression and ran into the errror message below. Similar issue has been previously addressed in this forum but I have applied all the suggestions without solution.
    The command and error message are:

    svy linearized : logistic heart ACE2more_1920 age3_1920 sex_1920 race4_1920 InsType_1920 povlev4_1920 BornUSA_1920
    (running logistic on estimation sample)
    an error occurred when svy executed logistic
    r(2000);

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte heart float(ACE2more_1920 age3_1920 sex_1920 race4_1920 InsType_1920 povlev4_1920 BornUSA_1920)
    2 1 1 2 2 2 4 1
    2 1 3 1 2 2 4 1
    2 1 2 2 2 2 2 1
    1 1 2 1 2 2 4 1
    2 2 1 2 4 1 2 1
    2 3 3 2 2 2 2 1
    2 2 3 1 2 2 2 1
    2 . 2 1 2 . 2 1
    2 3 3 1 3 2 4 1
    2 1 2 2 2 2 3 1
    2 2 1 2 2 2 3 1
    2 3 3 2 2 2 4 1
    2 1 2 1 2 2 4 1
    2 1 3 1 2 2 4 1
    1 2 3 1 2 2 3 1
    2 2 2 1 4 1 3 1
    2 1 1 2 4 2 4 1
    2 1 1 1 2 2 4 1
    2 2 3 2 4 1 1 2
    2 1 1 1 2 2 4 1
    2 . 2 1 2 2 4 1
    2 1 1 1 2 2 4 1
    2 1 3 1 3 2 4 2
    2 2 3 1 2 2 3 1
    2 1 1 2 2 2 4 1
    2 1 3 2 2 2 1 1
    2 3 3 1 1 1 4 1
    2 1 3 1 2 2 3 1
    2 1 1 2 2 2 4 1
    2 1 1 1 2 2 3 1
    2 1 1 2 3 2 4 1
    2 2 3 1 2 2 3 1
    1 1 3 1 2 2 4 1
    2 2 1 1 2 2 3 1
    2 1 2 1 2 2 4 1
    2 1 1 2 2 2 3 1
    2 1 3 1 2 2 4 1
    2 1 1 2 4 2 3 1
    2 1 2 1 2 2 2 1
    2 1 1 2 1 1 3 1
    2 1 3 1 2 1 1 1
    2 2 3 1 2 2 4 1
    2 3 2 2 2 1 1 1
    2 1 1 1 2 2 4 1
    2 3 3 1 4 4 1 1
    2 1 1 1 2 2 2 1
    1 3 1 2 3 1 1 1
    2 1 1 1 4 2 2 1
    2 1 3 2 2 2 4 1
    2 1 2 2 4 . 4 2
    2 2 3 2 2 2 4 1
    2 2 3 2 2 2 4 1
    2 3 1 2 4 2 4 1
    2 1 1 1 2 2 3 1
    2 1 3 1 4 1 2 2
    2 1 1 2 1 4 1 1
    2 2 3 1 2 2 3 1
    2 2 2 1 2 2 1 1
    2 1 3 2 4 2 3 2
    2 1 1 1 4 2 4 1
    2 1 2 1 4 2 4 1
    2 3 2 1 2 1 1 1
    2 1 3 2 2 2 4 1
    2 1 1 1 1 2 2 1
    2 1 3 1 2 2 4 1
    2 1 1 2 1 2 4 1
    2 1 3 2 4 2 4 1
    2 3 3 2 4 1 2 1
    2 3 3 2 2 2 4 1
    2 2 2 1 3 2 3 1
    2 1 2 1 3 1 1 1
    2 3 2 1 1 2 3 1
    2 1 2 2 4 2 4 1
    2 2 3 2 4 2 4 2
    2 2 3 1 3 2 2 1
    2 1 2 1 2 2 4 1
    2 3 2 2 3 2 1 1
    2 2 2 1 2 3 2 2
    2 1 1 2 2 1 1 1
    2 1 3 1 4 2 3 1
    2 1 3 2 4 2 3 1
    2 2 2 2 2 2 3 1
    2 1 1 1 2 2 4 1
    . 1 2 1 2 2 1 1
    2 2 3 2 3 1 2 1
    2 3 2 2 2 1 3 1
    2 1 2 1 2 2 4 1
    2 1 2 1 2 2 4 1
    2 1 2 1 3 2 4 1
    2 1 3 1 3 1 2 1
    2 1 2 1 3 2 4 1
    2 2 3 1 1 3 3 1
    2 3 3 2 4 2 3 1
    2 1 1 2 2 2 4 1
    2 2 2 1 4 1 3 1
    2 1 2 2 2 2 4 1
    1 1 2 2 2 2 4 1
    2 1 1 1 2 2 4 1
    2 1 3 2 2 2 4 1
    2 1 2 1 2 2 4 1
    end
    label values heart heart_lab
    label def heart_lab 1 "Yes", modify
    label def heart_lab 2 "No", modify
    label values ACE2more_1920 ACE2more
    label def ACE2more 1 "No adverse childhood experiences", modify
    label def ACE2more 2 "Experienced 1 ACE", modify
    label def ACE2more 3 "Experienced 2 or more ACEs", modify
    label values age3_1920 age3
    label def age3 1 "0-5 years old", modify
    label def age3 2 "6-11 years old", modify
    label def age3 3 "12-17 years old", modify
    label values sex_1920 sex
    label def sex 1 "Male", modify
    label def sex 2 "Female", modify
    label values race4_1920 race4
    label def race4 1 "Hispanic", modify
    label def race4 2 "White, non-Hispanic", modify
    label def race4 3 "Black, non-Hispanic", modify
    label def race4 4 "Other/Multi-racial, non-Hispanic", modify
    label values InsType_1920 InsType
    label def InsType 1 "Public health insurance only", modify
    label def InsType 2 "Private health insurance only", modify
    label def InsType 3 "Public and private insurance", modify
    label def InsType 4 "Uninsured", modify
    label values povlev4_1920 povlev4
    label def povlev4 1 "0-99% FPL", modify
    label def povlev4 2 "100%-199% FPL", modify
    label def povlev4 3 "200%-399% FPL", modify
    label def povlev4 4 "400% FPL or greater", modify
    label values BornUSA_1920 BornUSA
    label def BornUSA 1 "Children were born in US", modify
    label def BornUSA 2 "Children were born outside of US", modify

    Will appreciate your help.

    Thank you

  • #2
    logistic in Stata requires a 0/positive variable, so you need to recode your outcome.

    Code:
    recode heart (2=0)

    Comment


    • #3
      Hi Andrew,

      It worked perfectly, thank you so much.

      Comment

      Working...
      X