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
A
ReplyDeleteA
ReplyDeleteA
ReplyDeleteB. The online help doc states that
ReplyDelete'PROC MEANS excludes missing values for the analysis variables before calculating statistics. Each analysis variable is treated individually [...]'
yes, "Excludes" that means does not take
Deleteso the answer is A
B. I have just verified it in SAS by running a program below:
ReplyDeletedata 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....
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.
ReplyDeleteVariable N Mean
---------------------------------
shoe_number 4 7.5000000
val 3 4.6666667
---------------------------------
with PROC MEANS,
ReplyDeleteYou get a count of the non-missing and missing values for all your numeric variables.
So the answer is B
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.
ReplyDeletei 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..
ReplyDeleteAnswer 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..
ReplyDeleteB
ReplyDeleteA is 100% correct
ReplyDeleteThink it could be C
ReplyDeleteREAD READ carefully,
ReplyDeleteIt 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.
u da man !
DeleteA
ReplyDeleteproc means exclude missing value before calculating the mean.
ReplyDeleteA
ReplyDeleteIt's definitely A. From the following prog
ReplyDeletedata 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.
hey oscar, did you try that with some character values as well?
DeleteAnswer is A I agree with Oscar
ReplyDeletea
ReplyDeleteONLY NON MISSING NUM VALUES.
ReplyDeletethe answer is A. perhaps the question is a little confusing.
ReplyDeletesas takes the missing variable for the calculation but not the missing values in it.
A
ReplyDelete/*TRY THIS CODE*/
ReplyDeleteDATA 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
A
ReplyDeleteHello!! I'am glad to read the whole content of this blog and am very excited.Thank you.
ReplyDeleteตารางคะแนน
A
ReplyDeletedata shoes;
ReplyDeleteinput 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?