Diff for "FAQ/bar" - CBU statistics Wiki
location: Diff for "FAQ/bar"
Differences between revisions 4 and 5
Revision 4 as of 2006-07-27 11:39:34
Size: 1248
Editor: pc0082
Comment:
Revision 5 as of 2006-07-27 12:14:21
Size: 1643
Editor: pc0082
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
If a rating scale has a category which doesn’t occur e.g. ‘Very Unimportant’ this category is not shown in the bar charts. This can be a disadvantage for example in checking for Normality or even getting an impression of the complete range of possible data values. This can be overcome by weighting the cases. If a rating scale has a category which doesn’t occur, e.g. ‘Impaired’, this category is not shown in the bar charts. This can be a disadvantage, for example, in checking for Normality or even getting an impression of the complete range of possible data values. This can be overcome by weighting the cases.
Line 3: Line 3:
Example…. Let’s suppose we wish to graph group frequencies, held in a single column of raw (individual) data (FDAT), on a simple bar graph in SPSS. One or more of the groups doesn’t occur. The following procedure will produce the complete bar chart. '''Example''' Let’s suppose we wish to graph group frequencies, for abilities on a particular task on a simple bar chart. Nobody is classed as impaired. We, therefore, add a second variable, wdat, containing the frequencies and a small positive value, for example 0.001, for the non-occurring impaired group. This group will now be represented in the bar chart.
Line 5: Line 5:
 1. Add dummy ratings representing those which have not occurred to FDAT.
 1. Construct a weight variable (WVAR) which takes the value ‘1’ for all ratings which occur and some very small positive weight for the dummy cases e.g. 0.001.
 1. Go to Data:Weight Cases and place WVAR in the weight cases by box.
 1. Go to Graphs: Bar: Simple and input the categorical variable.
[THE SPSS SYNTAX IN THE BOX BELOW CAN BE PASTED INTO A SP SYNTAX WINDO AND RUN]
Line 10: Line 7:
You should now have a space on the x axis allocated for all possible ratings. {{{
* in the below the groups are defined by fdat with total
* frequencies (summed over individuals) wdat. If raw (individual)
* data is entered wdat takes value ‘1’ for each observed data
* point and ‘0.001’ for any data points which could have occurred * but did not.
Line 12: Line 13:
 *You could do this inputting ''total frequency'' for each bar graph level using the method above. WVAR would now represent the frequency per level with 0.001, as before, used for non-occurring levels. Data list free/
Fdat wdat.
Begin data
1 0.001
2 2
3 10
4 5
end data.

VAR LABELS FDAT ABILITY/
                WDAT WEIGHT /.

VALUE LABELS FDAT (1) IMPAIRED
                    (2) BELOW AVERAGE
                    (3) AVERAGE
                    (4) ABOVE AVERAGE.

DEFINE !MYBAR (!POS !TOKENS(1)
                      / !POS !TOKENS(1)
                      / !POS !CMDEND).
WEIGHT BY !2 .
GRAPH TITLE=!QUOTE(!3)
  /BAR(SIMPLE)=COUNT BY !1
  /MISSING=REPORT.
!ENDDEFINE.

!MYBAR FDAT WDAT DISTRIBUTION OF ABILITY GROUPS.
}}}

If a rating scale has a category which doesn’t occur, e.g. ‘Impaired’, this category is not shown in the bar charts. This can be a disadvantage, for example, in checking for Normality or even getting an impression of the complete range of possible data values. This can be overcome by weighting the cases.

Example Let’s suppose we wish to graph group frequencies, for abilities on a particular task on a simple bar chart. Nobody is classed as impaired. We, therefore, add a second variable, wdat, containing the frequencies and a small positive value, for example 0.001, for the non-occurring impaired group. This group will now be represented in the bar chart.

[THE SPSS SYNTAX IN THE BOX BELOW CAN BE PASTED INTO A SP SYNTAX WINDO AND RUN]

* in the below the groups are defined by fdat with total 
* frequencies (summed over individuals) wdat. If raw (individual)
* data is entered  wdat takes value ‘1’ for each observed data 
* point and ‘0.001’ for any data points which could have occurred * but did not.

Data list free/
Fdat wdat.
Begin data
1 0.001
2 2
3 10
4 5
end data.

VAR LABELS      FDAT     ABILITY/
                WDAT     WEIGHT /.  

VALUE LABELS   FDAT (1) IMPAIRED
                    (2) BELOW AVERAGE
                    (3) AVERAGE
                    (4) ABOVE AVERAGE.

DEFINE !MYBAR          (!POS !TOKENS(1)
                      / !POS !TOKENS(1)   
                      / !POS !CMDEND).
WEIGHT BY !2 .
GRAPH TITLE=!QUOTE(!3)
  /BAR(SIMPLE)=COUNT BY !1
  /MISSING=REPORT.
!ENDDEFINE.

!MYBAR FDAT WDAT DISTRIBUTION OF ABILITY GROUPS. 

None: FAQ/bar (last edited 2014-03-28 10:24:44 by PeterWatson)