BookmarkSubscribeRSS Feed
GN0001
Barite | Level 11
hello team,

Cleaning Data

data cleanme;

input group$ kilograms;

cards;

A 53.4

B 76.3

A 45.3

A 98.4

a 67.3

A 98.3

A 68.3

B 28.4

B 67.3

B 37.4

A 68.3

A 79.2

A 56.4

run;

1. Create a new dataset called cleanfinal from cleandata.

2. Set values for the Kilograms variable to between 20 and 40, inclusively.

3. If values in Kilograms are missing, or not in the 20 to 40 range, replace with the median Kilograms value found . (hint: you will do some conditional logic for Group 'A' and 'B', and you will set median kilograms for A and B)

Blue Blue
2 REPLIES 2
andreas_lds
Jade | Level 19

This looks like homework. What have you tried?

Here's an older topic, created by yourself dealing with the same problem: https://communities.sas.com/t5/SAS-Programming/proc-mean-with-a-where-clause-with-median/m-p/760304

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1249 views
  • 3 likes
  • 3 in conversation