[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: type mismatch when using svy jackknife

From (Jeff Pitblado, StataCorp LP)
Subject   Re: st: type mismatch when using svy jackknife
Date   Fri, 30 May 2008 11:04:55 -0500

Roman Kasal <> using -svy jackknife- with a string variable
-svyset- in the -strata()- option:

> Id like to ask what does the error below mean?
> . svyset ico [pweight=wahapopulace], strata(stratum) fpc(pocetZS) || _n,
> fpc(pocetzam)
> . svy jackknife: mean prumvyd
> I get:
> "
> (running mean on estimation sample)
> Jackknife replications (715)
> ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
> type mismatch
> post:  above message corresponds to expression 1, variable stratum
> post __00000N not found
> r(111);
> "
> Why the jackknife method needs to have special type for stratum??

The -svy- prefix commands are supposed to work with PSU and Strata variables
that are type numeric or string.  Roman has found that -svy jackknife- is not
handling string strata variables properly.

We have determined what is causing the problem and fixed it.  The fix will be
available in the next ado-file update.

In the mean time, Roman can generate a numeric version of the -stratum-
variable using

	. egen numstratum = group(stratum)

and then use this new variable in the -strata()- option of -svyset-.

While Stata's -svy- prefix commands allow the PSU and Strata variables to be
string vars, we recommend that these variables be converted to numeric vars
for survey datasets with a large number of observations.  We recommend this
because string comparisons take more time than scalar numeric comparisons.  So
converting your string PSU and Strata variables to numeric vars could result
in faster variance calculations.

*   For searches and help try:

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