*Copyright @ www.mycsg.in;


What is the word meaning of subset?

  1. a part of a larger group of related things.
Subset observations from a dataset

Where do we need to subset data?

Create sample input datasets

Subset the records using 'where' statement

Create a dataset named males by subsetting the male student records from class dataset

Create a dataset named females_preteen by subsetting female student records whose age is less than 13 from class dataset

Create a dataset named cars_mileage by subsetting the cars with mpg_city > 24 or mpg_highway >30 from cars dataset

Subsetting the records with subsetting if statement

Create a dataset named females by subsetting female records using subsetting if statement

Create a dataset named select_sedans by subsetting Sedan cars with a highway mileage greater than 35 using subsetting if statement

Create a dataset named cheap_mileage by subsetting the cars with msrp < 15000 dollars or city mileage greater than 40 using subsetting if statement

Subsetting the records using if ... then output

Create a dataset named tall by subsetting the students with height greater than 60 using if ... then output

Subsetting the records using if ... then delete

Create a dataset named short by subsetting the students with height less than 60 using if ... then delete