The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Tab2 using survey weights
Tab2 using survey weights [message #10567] Tue, 09 August 2016 07:46 Go to next message
jane_cheatley is currently offline  jane_cheatley
Messages: 6
Registered: July 2016
Location: London

I am currently look at panel data for 10 countries using DHS data. I am hoping to run chi-squared tests for my bivariate logistic regressions in order to choose which variables to include in my multi-variate regression.

Given I am running multiple multi-variate regressions (e.g. all countries and year, separate country for all years etc) I would like a quick way to get results.

I know I can use 'tab2, first only' to do this - e.g. tab2 dead bednet electricity urban, chi2 firstonly. This command, however, does not take into account survey weights. I cannot put 'svy' infront of the command as tab2 is not supported by svy. I noticed that fweights is the only weight supported by tab2, however, DHS has non-integer weights, therefore fweights does not work.

My question is, how can I run 'tab2, first only' to get results for chi-squared tests, taking into account survey weights?

Any assistance would be greatly appreciated.


Re: Tab2 using survey weights [message #11163 is a reply to message #10567] Fri, 11 November 2016 10:17 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 2314
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

You can do something that is equivalent to a chi square test. Say you have two categorical variables y and x. First, ignore svy and do the following two commands: "tab y x, all" and "mlogit y x". Compare the maximum likelihood chi square (not Pearson) from the first command with the chi square (you only get the maximum likelihood chi square). You will see that they are the same. The value, the df, and the p values will be the same. If in either command you reverse the y and the x, the results will be the same.

You cannot use svyset and tab to get a chi square but you CAN use svyset with mlogit. Do "svyset: mlogit y x". This time you will not get a chi-square but you will get an F. The p value for the F would be the same as what a p value for a chi-square would be. This is a way to test the null hypothesis that y and x are independent with the svy adjustments. Again, you get the same results if you reverse y and x. If either y or x happens to be binary, then you can use "svyset: logit y x" if, say, it is y that has two values, rather than mlogit. (For logit, the values must be coded 0 and 1; for mlogit they could be 1 and 2.)

If you do this, you don't get a chi-square, but you do get a test statistics for the null hypothesis of independence (or homogeneity) and a p-value, which should be all you really want.
Previous Topic: Education level in single years in CR
Next Topic: Relative index of inequality calculation
Goto Forum:

Current Time: Wed Jun 23 14:53:35 Coordinated Universal Time 2021