The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Error occurred when svy executed logistic
Error occurred when svy executed logistic [message #6818] Mon, 20 July 2015 08:31 Go to next message
Abisiku is currently offline  Abisiku
Messages: 8
Registered: June 2014
Location: Lusaka
Member
I was trying to run a logistic regression and got the following result.

xi: svy: logistic age_fmarcat i.highest_ed i.occupation i.religion i.wealth_index i.residence i.region i.ethnicity i.mass_med
i.highest_ed _Ihighest_e_0-2 (naturally coded; _Ihighest_e_0 omitted)
i.occupation _Ioccupatio_0-4 (naturally coded; _Ioccupatio_0 omitted)
i.religion _Ireligion_1-3 (naturally coded; _Ireligion_1 omitted)
i.wealth_index _Iwealth_in_1-3 (naturally coded; _Iwealth_in_1 omitted)
i.residence _Iresidence_1-2 (naturally coded; _Iresidence_1 omitted)
i.region _Iregion_1-10 (naturally coded; _Iregion_1 omitted)
i.ethnicity _Iethnicity_1-7 (naturally coded; _Iethnicity_1 omitted)
i.mass_med _Imass_med_0-1 (naturally coded; _Imass_med_0 omitted)
(running logistic on estimation sample)
an error occurred when svy executed logistic
r(2000);

end of do-file

r(2000);

Am kindly asking for help as I am failing to figure out what went wrong. Thanks.


ENSI
Re: Error occurred when svy executed logistic [message #6834 is a reply to message #6818] Mon, 20 July 2015 16:10 Go to previous messageGo to next message
Reduced-For(u)m
Messages: 292
Registered: March 2013
Senior Member

This is really a question for the Stata forum (Statalist), but two quick possibilities:

1 - from Nick Cox, Stata guru: "Nevertheless your problem is likely to be very simple. error 2000 here often means that you have one or more variables that should be numeric in string form. logit requires all of the variables fed to it to be numeric. Look carefully at the results of describe to see if any of the variables you use is actually string. If so, consider using destring or encode as appropriate to produce numeric variables."

http://stackoverflow.com/questions/20377682/logistic-regress ion-in-stata-error-code

2 - what is the variable "age_fmarcat"? Does it only take on the values of 0 and 1? If it is a category with more variables, it cannot be the left hand side of a logistic regression.
Re: Error occurred when svy executed logistic [message #6975 is a reply to message #6834] Fri, 07 August 2015 10:14 Go to previous message
Abisiku is currently offline  Abisiku
Messages: 8
Registered: June 2014
Location: Lusaka
Member
Thank you for your response. It helped. The outcome variable (child marriage)is categorical. When i put Yes & No, i was able to run the regression.

ENSI
Previous Topic: weighting to obtain subnational summary estimates
Next Topic: Do I need to De-normalize and Pool Data for Trends Over Time in a Single Country?
Goto Forum:
  


Current Time: Fri Dec 27 01:11:46 Coordinated Universal Time 2024