st: bar graph problem

 From "Tunga Kantarci" <[email protected]> To <[email protected]> Subject st: bar graph problem Date Wed, 30 Apr 2008 15:31:32 +0200

```Hello,

I use the following command to generate a categorized bar graph:

graph bar (asis) q41a if grandom == 1, over(frandom_)

However, I receive the following message:

variables frandom_ _variables do not uniquely identify the observations

I don�t understand why my "frandom_" variable need to identify the
observations uniquely.
(by the way I have an "id" variable which uniquely identifies observations)
I also do not understand what "_variables" refers to.

If I run the command without "asis" then I get the following:

graph bar q41a if grandom == 1, over(frandom_) variable __000006 not found
in using data

In particular, what I am trying to do is this: see the three tabulations
below. What I want is a categorized bar graph, where the categorization is
over frandom. That is, three bars in a bunch will present together "Plan van
name5", where each bar refers to one of the "frandom"s. There will be three
bunches with each bunch having three bars. But unfortunately, I receive the
message I mentioned.
�

tab q41a if grandom == 1 & frandom == 1
q4 age |
randomisation 1 3/4 |      Freq.     Percent        Cum.
--------------------+-----------------------------------
plan van ^name5 |         21       42.00       42.00
plan van ^name6 |         14       28.00       70.00
plan van ^name7 |         15       30.00      100.00
--------------------+-----------------------------------
Total |         50      100.00
�

tab q41a if grandom == 1 & frandom == 2
q4 age |
randomisation 1 3/4 |      Freq.     Percent        Cum.
--------------------+-----------------------------------
plan van ^name5 |         32       61.54       61.54
plan van ^name6 |         10       19.23       80.77
plan van ^name7 |         10       19.23      100.00
--------------------+-----------------------------------
Total |         52      100.00
�

tab q41a if grandom == 1 & frandom == 3
q4 age |
randomisation 1 3/4 |      Freq.     Percent        Cum.
--------------------+-----------------------------------
plan van ^name5 |         23       58.97       58.97
plan van ^name6 |          4       10.26       69.23
plan van ^name7 |         12       30.77      100.00
--------------------+-----------------------------------
Total |         39      100.00

tab frandom

q4 |
(standard) |
item |
randomizati |
on |      Freq.     Percent        Cum.
------------+-----------------------------------
1 |        627       34.19       34.19
2 |        600       32.72       66.90
3 |        607       33.10      100.00
------------+-----------------------------------
Total |      1,834      100.00

tab grandom

q4 |
(standard) |
item |
randomizati |
on pension |
income |      Freq.     Percent        Cum.
------------+-----------------------------------
1 |        465       25.35       25.35
2 |        478       26.06       51.42
3 |        452       24.65       76.06
4 |        439       23.94      100.00
------------+-----------------------------------
Total |      1,834      100.00

tab q41a

q4 age |
randomisation 1 3/4 |      Freq.     Percent        Cum.
--------------------+-----------------------------------
Plan from ^name5 |        220       52.26       52.26
Plan from ^name6 |         53       12.59       64.85
Plan from ^name7 |        148       35.15      100.00
--------------------+-----------------------------------
Total |        421      100.00

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```