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

# st: Re: Tabulation/Frequency advice, please

 From "Martin Weiss" <[email protected]> To <[email protected]> Subject st: Re: Tabulation/Frequency advice, please Date Sat, 13 Jun 2009 14:00:25 +0200

```<>

```
Well, you triggered this behavior by adding the option -row- to your tabulation. Here is code to change it:
```
**
clear*

input report issue
0 1
0 1
0 2
0 2
0 3
0 3
0 4
0 4
0 4
0 4
1 1
1 1
1 1
1 1
1 1
1 2
1 2
1 3
1 4
1 4
end

compress

//get two years
expand 2

la def rep /*
*/0 "not reported"/*
*/ 1 "reported"

la val report rep

gen year=/*
*/cond(_n<=`=_N/2',0,1)

list, noobs /*
*/ sepby(issue )

by year, sort:/*
*/ tabulate report/*
*/ issue, cell
**

HTH
Martin
_______________________
```
----- Original Message ----- From: "CHIDLOW Agnieszka" <[email protected]>
```To: <[email protected]>
Sent: Friday, June 12, 2009 11:07 PM
Subject: st: Tabulation/Frequency advice, please

```
```Hello,

```
I would be very grateful is someone help me, because I have been trying to figure it out for a while.
```
I am tabulating two variables using the syntax below:

by year, sort:tab2 suronly issue, row

Below is one  of the answer s I get:

-> year = 0

-> tabulation of suronly by issue

+----------------+

| Key            |

|----------------|

|   frequency    |

| row percentage |

+----------------+

Survey mail |              Volume and Issue

and on-line |   Issue 1    Issue 2    Issue 3    Issue 4 |     Total

-------------+--------------------------------------------+----------

Not reported |         2          2          2          4 |        10

|     20.00      20.00      20.00      40.00 |    100.00

-------------+--------------------------------------------+----------

Reported |         5          2          1          2 |        10

|     50.00      20.00      10.00      20.00 |    100.00

-------------+--------------------------------------------+----------

Total |         7          4          3          6 |        20

|     35.00      20.00      15.00      30.00 |    100.00

```
This is all fine, but iwhat I need at the moemnt is a way (i.e. a syntex) through which I can obtain the percentage of 5 "Reported" from 20 "Total" NOT from 10 Total as shown in the table above.
```

Will be very greatful for any help,

Aggie

```
The information in this email is confidential and is intended solely for the addressee. Access to this email by anyone else is unauthorised.
```

```
If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, except for the purpose of delivery to the addressee, is prohibited and may be unlawful. Kindly notify the sender and delete the message and any attachment from your computer.
```

*
*   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/

```
```
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index