BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ChuksManuel
Pyrite | Level 9

Hello,

 

I am trying to find the mean of variables in an observation that has missing values. 

for example, if  T1 T2 T3 are the variables, their mean would be (t1 +t2+t3)/3= T_mean.

However, i discovered that SAS ouput a missing value for T_mean if any of the T1-T3 values are missing.

My question is how do i make sas treat the missing as zero in order to compute the mean.

 

 

 

 

 

1 ACCEPTED SOLUTION
4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20

Can you show the code you have now?

ChuksManuel
Pyrite | Level 9

Thanks!

PeterClemmensen
Tourmaline | Level 20

@ChuksManuel just to add to this thread. The Mean Function ignores missing values. It does not treat them as zero. There is a big difference. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1190 views
  • 2 likes
  • 3 in conversation