[DDI-users] DDI-users Digest, Vol 105, Issue 6 (SAS/Stata extended missings)

Wendy Thomas wlt at umn.edu
Tue Jun 24 10:50:53 EDT 2014


Given that a) different software has different conventions, b) training
people to do the "right thing" is difficult and the definition of "right"
varies, and c) we have a lot of legacy data, is the following a fair
statement.

In DDI where you declare the file type (PhysicalStructure) there should be
an option for mapping previously declared missing (invalid) values to the
appropriate value for the particular statistical package (and version if
applicable). This seems to be necessary even if someone creates the "right"
values within a specific statistical package as many
archives/libraries/etc. provide data or set up files in multiple formats.

If so, then I'll enter this in the issue tracker along with the email texts
so it doesn't get lost. I will then talk with Therese and figure out the
best way to make sure that this issue along with other "future" issues in
Mantis get fed into the Moving Forward development process.

Wendy


On Tue, Jun 24, 2014 at 8:56 AM, Hoyle, Larry <larryhoyle at ku.edu> wrote:

>  In SAS and Stata the values ._   .a - .z are special numeric values,
> treated as missing, which compare less than the smallest valid value.
>
>
>
> If you use -1, for example, to represent “refused” and compute a mean on
> the variable the -1 will be included in the computation – not ignored.
>
> Using a scheme like
>
> value timetopg
>
> 1 = '1-2 mos'
>
> 2 = '3-5 mos'
>
> 3 = '6-12 mos'
>
> 4 = ' > 1 yr'
>
> .r = 'Refused'
>
> .d = "don't  remember"
>
> .s  = 'set to missing by rule'
>
> .o = 'other missing'
>
> ;
>
>
>
> Would allow you to compute statistics ignoring the missing values as well
> as tabulations using the missing values (e.g. computing the % refused).
>
>
>
> In packages like SPSS one can specify that otherwise valid values (like -1
> in your example) can be treated as missing. The advantage of using “out of
> band” values is that they cannot accidentally be treated as valid values.
>
>
>
> R, I believe, only has two missing values: NA and NaN. In order to prevent
> treating -1 - -4 as valid values in your example in R you would need to
> transform the variable to convert all of these values to NA.  If you are
> moving data from any software that allows multiple missing values SPSS, SAS
> or Stata to R you may need to use NA as the missing value for all of the
> categories and perhaps create a secondary variable preserving the different
> values of missing.
>
>
>
>
>
>
>
> --- Larry Hoyle
>
>
>
>
>
> *From:* ddi-users-bounces at icpsr.umich.edu [mailto:
> ddi-users-bounces at icpsr.umich.edu] *On Behalf Of *Adrian Du?a
> *Sent:* Tuesday, June 24, 2014 4:03 AM
> *To:* Data Documentation Initiative Users Group
> *Subject:* Re: [DDI-users] DDI-users Digest, Vol 105, Issue 6 (SAS/Stata
> extended missings)
>
>
>
> Hi Bob,
>
>
>
> I've never used SAS, but have to ask something regarding these different
> types of missings.
>
> Is there any particular advantage of .r, .d and .m over something like:
>
>
>
> value timetopg
>
> 1 = '1-2 mos'
>
> 2 = '3-5 mos'
>
> 3 = '6-12 mos'
>
> 4 = ' > 1 yr'
>
> -1 = 'Refused'
>
> -2 = "don't  remember"
>
> -3 = 'set to missing by rule'
>
> -4 = 'other missing'
>
> ;
>
>
>
> I'm thinking about cross portability of these codes, and the above
> suggestion would work (I think) in every statistical package while .d and
> .r etc are specific for SAS only.
>
>
>
> Thanks,
>
> Adrian
>
>
>
>
>
>
>
> On Mon, Jun 23, 2014 at 7:49 PM, Bob McConnaughey <bobmcconn at gmail.com>
> wrote:
>
> i suspect i'm belaboring the obvious here, but here's how SAS treats
> numeric missings
>
> SAS numeric missings appear to be "character strings" - but they are
> treated, within SAS (and Stata i believe) as "invented" numbers, smaller
> than the "smallest" negative number.  eg -1*10**10000 > .z > .a > . > ._ ;
>  (though i don't think i've ever seen "._" used).  However their great
> virtues are: 1. As "known" missings they automatically get excluded from
> computations involving the variable they represent.  And, like any other
> value (character or numeric) the can be described using formats..  That is
> when you do, say, a frequency proc and assign formats to the missing you'd
> see something like:
>
> time_to_pregnancy1
>
> value timetopg
>
>   1-2 = '1-2 mos'
>
>   3-5 = '3-5 mos'
>
>   6-12 = '6-12 mos'
>
>  13-high = ' > 1 yr'
>
>  .r         = 'Refused'
>
>  .d        = "don't  remember"
>
>  .m       = 'set to missing by rule'
>
> .          = 'other missing'
>
> ;
>
> Value labels are the equivalent SPSS feature (i think..i haven't used SPSS
> in 35 yrs) and even now most of our original questionnaires use "out of
> range" numbers for special missing values.  But the number of times
> post-docs and researchers have come up with funky basic descriptive
> statistics because, oh, "99" was used for a missing value for
> "height_inches" is well nigh uncountable.  And matters are getting worse
> because there's a general tendency to not use codebooks any more;  instead
> projects rely on "annotated questionnaires" and SAS "proc contents" I am
> very much hoping to get people here to go back to using codebooks and the
> various DDI products SHOULD be convincing. (well, convincing for people
> other than the small group of reproductive epidemiology researchers I work
> with most closely).
>
>
>
> thanks for the responses!
>
> Bob McC....
>
> "At times like this, an adult needs a drink."
> Dance, Dance, Dance.  H. Murakami
>
>
>
>
>
>
>
>
> _______________________________________________
> DDI-users mailing list
> DDI-users at icpsr.umich.edu
> http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users
>
>
>
>
>
> --
>
> Adrian Dusa
> University of Bucharest
> Romanian Social Data Archive
> 1, Schitu Magureanu Bd.
> 050025 Bucharest sector 5
> Romania
> Tel.:+40 21 3126618 \
>         +40 21 3120210 / int.101
> Fax: +40 21 3158391
>
> _______________________________________________
> DDI-users mailing list
> DDI-users at icpsr.umich.edu
> http://lists.icpsr.umich.edu/mailman/listinfo/ddi-users
>
>


-- 
Wendy L. Thomas                              Phone: +1 612.624.4389
Data Access Core Director                 Fax:   +1 612.626.8375
Minnesota Population Center             Email: wlt at umn.edu
University of Minnesota
50 Willey Hall
225 19th Avenue South
Minneapolis, MN 55455
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.icpsr.umich.edu/pipermail/ddi-users/attachments/20140624/1cf11703/attachment-0001.html 


More information about the DDI-users mailing list