ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 28

Unless specified, which variables and data values are used to calculate statistics in the MEANS procedure?
A. non-missing numeric variable values only
B. missing numeric variable values and non-missing numeric variable values only
C. non-missing character variables and non-missing numeric variable values only
D. missing character variables, non-missing character variables, missing numeric variable values, and non-missing numeric variable
values
Click Comment link to get answer

31 comments:

  1. Anonymous8:56 AM

    B. The online help doc states that
    'PROC MEANS excludes missing values for the analysis variables before calculating statistics. Each analysis variable is treated individually [...]'

    ReplyDelete
    Replies
    1. Anonymous3:59 PM

      yes, "Excludes" that means does not take
      so the answer is A

      Delete
  2. Anonymous3:23 AM

    B. I have just verified it in SAS by running a program below:

    data shoes;
    input shoe_number val;
    datalines;
    6 2
    7 .
    8 4
    9 8
    ;
    proc means data = shoes;
    run;

    The MEANS procedure gives default statistics to both variables....

    ReplyDelete
  3. Anonymous9:28 AM

    Answer is A. In response to above comment, you just gave the program not the output. Below is the output where you can clearly see for variable val N is 3 not 4, so proc means only consider numeric non-missing values for that variable to calculate its statistics, so answer is A.
    Variable N Mean
    ---------------------------------
    shoe_number 4 7.5000000
    val 3 4.6666667
    ---------------------------------

    ReplyDelete
  4. Anonymous10:40 AM

    with PROC MEANS,

    You get a count of the non-missing and missing values for all your numeric variables.

    So the answer is B

    ReplyDelete
  5. Anonymous2:15 PM

    The answer is A. proc means, and in general other SAS procedures that perform calculations, will not factor in missing values. However, you can specify for missing values to affect proc means by using option MISSING.

    ReplyDelete
  6. i think ans is B. it doesnt mean that nonmissing variables r not used. at last missing variables are used but missing values are not considered. in out put .. so think ans is B..

    ReplyDelete
  7. Anonymous2:39 PM

    Answer is A : Because if proc means considers missing values then in the output (N,Std Dev,Minimum,Maximum) there should be a period '.' in the "minimum" column. So proc means takes only non-missing values..

    ReplyDelete
  8. Anonymous10:18 AM

    A is 100% correct

    ReplyDelete
  9. Anonymous4:40 PM

    Think it could be C

    ReplyDelete
  10. Anonymous11:27 AM

    READ READ carefully,
    It is not asking whether it runs or not.

    But question is,
    Unless specified, which variables and data values are used to calculate statistics in the MEANS procedure?

    Mean calculation , only nun-missing variables are used.
    Now find the answer again.

    ReplyDelete
  11. Anonymous6:13 AM

    proc means exclude missing value before calculating the mean.

    ReplyDelete
  12. It's definitely A. From the following prog
    data shoes;
    input shoe_number val;
    datalines;
    6 2
    7 .
    8 4
    9 8
    ;
    proc means data = shoes;
    run;
    i have the output
    shoe_number 4 7.5000000
    val 3 4.6666667
    proc means excluded the missing value of val and therefore computed the mean with 3 obs:(2+4+8)/3=4.66. SAS did not consider the missing value.
    However, if we specify in the program an option to go with the means proc, the result willbe different.

    ReplyDelete
    Replies
    1. Anonymous11:19 PM

      hey oscar, did you try that with some character values as well?

      Delete
  13. Anonymous8:05 AM

    Answer is A I agree with Oscar

    ReplyDelete
  14. SINGH5:05 PM

    ONLY NON MISSING NUM VALUES.

    ReplyDelete
  15. Anonymous11:30 AM

    the answer is A. perhaps the question is a little confusing.
    sas takes the missing variable for the calculation but not the missing values in it.

    ReplyDelete
  16. Anonymous9:48 PM

    /*TRY THIS CODE*/
    DATA work.hardwork;
    INFILE DATALINES DSD;
    INPUT num1 name $ num2;
    DATALINES;
    1,Hi,1
    2,All,.
    3,SASusers,3
    4,,4
    ;
    RUN;
    PROC MEANS DATA=pieces;
    RUN;

    In the above code missing character and missing numeric is present.
    The result shows:
    N Mean Std Dev Minimum Maximum
    2 2.0000000 1.4142136 1.0000000 3.0000000

    N=2. It didn't take the missing character and missing numeric variable data values into consideration.
    /* ANSWER is C */

    Hope this helps someone out there

    ReplyDelete
  17. Hello!! I'am glad to read the whole content of this blog and am very excited.Thank you.
    ตารางคะแนน

    ReplyDelete
  18. Anonymous6:19 PM

    data shoes;
    input shoe_number val;
    datalines;
    6 2
    7 .
    8 4
    9 8
    ;
    proc means data = shoes;
    run
    in this example, even though there is a missing value in the variable val , still it is caliculating the values for that variable.
    which means does the Proc Means considering missing numeric variable values and non-missing numeric variable values to caliculate statistics?
    please can someone explain?

    ReplyDelete