# Investigate and clean the data set sample.trial # Use the function, str( ) to list:   # the class of sample.trial # the number of observations and variables # the variable names and types # The variables gender and treatment should be factors  # (categorical variables). If these variables are not factors, # please change both variables to factors. # Use the str() function to check that the changes have been # made correctly. # List the first 11 lines of the data set # Summarize the data set using summary( ) ?summary() # Convert the numeric variable age into the factor age.groups # using the function cut( ) and the following  # breaks:  17, 25, 39, 60 # Assign the new variable, age.groups, to the data frame, sample.trial # NOTE:   Review Lecture 6 Class Notes -  #         Converting continuous variables to categorical variables ?cut() # Check:  Print the first 11 observations # Create a subset of males only and assign this subset to the # object, males ?subset() # Use the object males to create a frequency table for the # variable, age.group

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
age gender treatment
26 F A
32 F B
18 M B
29 F A
35 F B
35 M A
38 F B
55 M B
56 M A
34 F A
22 M A
22 F A
23 F B
35 F B
34 F A
22 F B
34 M B
56 F A
59 F B
29 M A
45 F A
43 F B
33 F B
23 M A
49 F A
51 F A
23 F B
38 F A
34 M B
19 F A
39 F B
40 M B

# Investigate and clean the data set sample.trial # Use the function, str( ) to list:   # the class of sample.trial # the number of observations and variables # the variable names and types # The variables gender and treatment should be factors  # (categorical variables). If these variables are not factors, # please change both variables to factors. # Use the str() function to check that the changes have been # made correctly. # List the first 11 lines of the data set # Summarize the data set using summary( ) ?summary() # Convert the numeric variable age into the factor age.groups # using the function cut( ) and the following  # breaks:  17, 25, 39, 60 # Assign the new variable, age.groups, to the data frame, sample.trial # NOTE:   Review Lecture 6 Class Notes -  #         Converting continuous variables to categorical variables ?cut() # Check:  Print the first 11 observations # Create a subset of males only and assign this subset to the # object, males ?subset() # Use the object males to create a frequency table for the # variable, age.group  

Expert Solution
Step 1

To investigate and clean the data set sample.trial, we can follow these steps:

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Introduction to Template
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education