Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: automatic disclosure in tables


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: automatic disclosure in tables
Date   Wed, 16 Nov 2011 18:06:05 +0000

You could include zeros too:

sysuse auto, clear
gen edu=round(mpg,5)
ren rep78 sex
gen one=!mi(sex)
contract sex edu, zero 
la de c 0 "\" 1 "\" 2 "\"
la val _freq c
tabdisp sex edu, c(_freq)


Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Winter
Sent: 16 November 2011 16:42
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: RE: automatic disclosure in tables

A solution that does not show 0 and >0 the same, but does allow 
replacement with a character:


sysuse auto, clear
gen edu=round(mpg,5)
ren rep78 sex
gen one=!mi(sex)
collapse (count) count=one , by(sex edu)
la de c 1 "\" 2 "\"
la val c c
tabdisp sex edu, c(count)

Nick Winter


On 11/16/2011 11:09 AM, Nick Cox wrote:
> This is a good idea.
>
> It shows cells with zeros and ones identically, which may well be a feature for Percy.
> Similarly the threshold is easy to tune.
>
> What I meant by not trivial was that inserting other characters in the table would be difficult, but Austin is clearly right that blanking out cells is more straightforward.
>
> Nick
> n.j.cox@durham.ac.uk
>
> Austin Nichols
>
> Percy Scheller--
>
> Is the kind of thing that is wanted?
>
> sysuse auto, clear
> gen edu=round(mpg,5)
> ren rep78 sex
> table sex edu
> egen ct=count(sex), by(sex edu)
> table sex edu if ct>1
>
>
>
> On Wed, Nov 16, 2011 at 5:20 AM, Nick Cox<n.j.cox@durham.ac.uk>  wrote:
>> I don't recall any such command. It doesn't sound at all trivial to program. It seems easier to edit output, or even to write programs to edit output.
>>
>> In this particular case, suppression seems counter-productive!
>>
>> Nick
>> n.j.cox@durham.ac.uk
>>
>> percy
>>
>> I once discovered an ado, which helps to automatically disclosure/suppress
>> cell content if it makes a reidentification of single persons possible.
>> Unfortunatelly this is years ago, I can't remember it or find it in my
>> ado-files. Has anybody a hint for me?!
>>
>> Thanks in advance
>>
>> Percy Scheller
>>
>> Example (see low educated male, infact you might need to suppress a second
>> information, too):
>>
>>
>> . table sex edu
>> ----------------------------------
>>           |       Education
>>       Sex |    low  medium    high
>> ----------+-----------------------
>>      male |      1       6       4
>>    female |      8      53      26
>> ----------------------------------
>>
>> . table sex edu
>> ----------------------------------
>>           |       Education
>>       Sex |    low  medium    high
>> ----------+-----------------------
>>      male |      /       6       4
>>    female |      8      53      26
>> ----------------------------------
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index