The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Multilevel modeling in DHS-Sri Lanka
Re: Multilevel modeling in DHS-Sri Lanka [message #16614 is a reply to message #16598] Wed, 06 February 2019 10:09 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3164
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

"Type" refers to whether the variable is stored as a number or as a string (that is, as characters). In general, you get this error when you accidentally mix numeric and string variables within a command or ask for an operation with a string variable that can only be done with a numeric variable. My guess is that your QACLUST is coded with numbers such as 1, 2, 3, etc., but you have somehow specified those numbers to be read as characters.

The data files already contain a variable that is the cluster id code. It's v001 in the IR and BR and KR files, hv001 in the HR and PR files, and mv001 in the MR file. It's a numeric variable, and your code will work fine if you use it in place of QACLUST.

To repeat, I believe that your QACLUST has been constructed as a string variable and that's the problem. To find out how QACLUST is being interpreted by Stata, enter "describe QACLUST". Good luck.
 
Read Message
Read Message
Read Message
Previous Topic: Family structure
Next Topic: Merging Datasets and Matching Observations BDHS 2007
Goto Forum:
  


Current Time: Sun Sep 29 00:16:36 Coordinated Universal Time 2024