Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Conformability error in svytab

From (Jeff Pitblado, Stata Corp.)
Subject   Re: st: Conformability error in svytab
Date   Fri, 21 Jun 2002 18:37:55 -0500

Arnold Levinson <> wrote in about a problem with svytab.

> When using -- svytab var1 var2, subpop(varname) missing obs -- I get
> conformability error r(503). If I omit any one of the three options, I get
> results. Any ideas?

Then Lee Sieswerda <> points to the spot in the code
where the conformability error occurs.

> Interesting.... I also get a conformability error, but it depends on whether
> there is missing data in either of the two variables being used. The results
> are like this:
> missing + missing = conformability error
> missing + no missing = conformability error
> no missing + no missing = no conformability error
> A conformability error occurs when a program tries to combine two matrices
> that are of the same dimensions. A -trace- indicates that the conformability
> error occurs after this line:
> mat `J' = `J'*`Obs''
> Like you, I can generate this conformability error in some of my data with
> the following command:
> svytab q1 q2, subpop(subgrad9) missing obs
> 1. one or both of q1 and q2 have some missing data, AND
> 2. the binary subpopulation variable (subgrad9 in this case) has a different
> set of missing values from q1 and q2
> I can get around the conformability error by making the missing value
> structure of the subpop variable the same as the variables I want to
> tabulate, like so:
> gen subgradtemp = subgrad9
> replace subgradtemp = . if q4==. | q5==.
> Now, running the command with the new subpop variable eliminates the
> conformability error, like so:
> svytab q5 q4, subpop(subgradtemp) missing obs
> I'm not sure if StataCorp could do anything to fix this. The code for svytab
> is pretty darn complicated. However, it might be worth mentioning a
> workaround like this one in the documentation of svytab.

Thanks to Lee, I am able to reproduce the problem.  I believe I've found the
source of the problem and a solution.  I hope to have this fixed and ready for
the next ado file update.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index