SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Creating Bar and Pie Charts

Select the best answer for each question and click Score My Quiz.

  1. Which SAS statement below invokes a SAS/GRAPH procedure to produce a chart using a SAS data set named Sales1999 in a SAS data library assigned the libref Stats?

     a.   proc gchart data=stats.sales1999;
     b.   proc chart data=stats.sales1999;
     c.   proc chart data=sales1999.stats;
     d.   proc gchart data=sales1999.stats;

  2. Given the program below, which statement would you add to produce a horizontal bar chart that calculates the average of the variable Profits for each value of the variable Style?
    proc gchart data=houses.sales;
       ???
    footnote1 '1999 New House Profits';
    run;

     a.   hbar profits / var=style stat=mean;
     b.   hbar style / sumvar=profits type=mean;
     c.   hbar style / sum=profits type=avg;
     d.   hbar style / var=profits stat=mean;

  3. One statement in the following program contains an error. Which statement is it?
    proc gchart data=crimes.misdmnr;
       pie region / type=sum;
       where robbery gt 300;
    title2 'Crimes by Region';
    run;

     a.   PROC GCHART
     b.   PIE
     c.   WHERE
     d.   TITLE

  4. Which statement would you add to the program below to create a vertical bar chart displaying the sum of the variable Balance for each value of the variable Account?
    proc gchart data=store1.ledger;
       ???
       where status='PAST DUE';
    run;

     a.   vbar account / sumvar=balance;
     b.   vbar account / type=sum;
     c.   vbar account / sumvar=balance type=sum;
     d.   either a or c

  5. What statistic is displayed in the bar chart produced by the following program?
    proc gchart data=houses.rentals;
       vbar style;
    run;

     a.   FREQ
     b.   SUM
     c.   PCT
     d.   There is no default statistic.

  6. If you are using RUN-group processing in interactive mode, which of the following methods would NOT end the PROC GCHART procedure?

     a.   submitting a DATA step
     b.   submitting another RUN statement
     c.   submitting a QUIT statement
     d.   submitting another PROC step

  7. In the PROC GCHART step below, which statement or statements contain an error?
    proc gchart data=sales.houses;
       pie style / type=cfreq;
       vbar style / sumvar=saleprice type=percent;
       hbar style / sumvar=saleprice type=mean;
    run;

     a.   PIE statement
     b.   VBAR statement
     c.   HBAR statement
     d.   both a and b

  8. To view a permanently stored chart in a subsequent SAS session, which of the following windows can you use?

     a.   The GRAPH window
     b.   The Results window
     c.   The Explorer window
     d.   both a and c

  9. Which of the following statements is false?

     a.   The PATTERNID=MIDPOINT option is used to vary the colors and patterns for the bars in bar charts.
     b.   The FILL= option is used to change the fill pattern in PIE charts.
     c.   If you use the FILL=S option and there are fewer colors in the color list than there are pie slices, the hatch pattern will be used for some slices.
     d.   The default fill for horizontal and vertical bar charts specifies that all bars will be the same solid color.

  10. Which statement is true for both pie and bar charts?

     a.   Character chart variables create one slice or bar for each variable value.
     b.   Numeric chart variables create one slice or bar for each variable value.
     c.   You can use the FILL= option to specify the fill pattern for bars and slices.
     d.   You must use the TYPE= option if the chart variable is numeric.



back||next

Terms of Use & Legal Information | Privacy Statement