Lab 1B Assignment_02

.pdf

School

Harrisburg University of Science and Technology *

*We aren’t endorsed by this school

Course

502

Subject

Statistics

Date

Jun 6, 2024

Type

pdf

Pages

5

Uploaded by beksg00

Report
Assignment: Lab1B: Intro to Data Basics II Lin-Chun Roxanne Wang (ID#274217) November 13, 2019 1 Make a scatterplot of weight versus desired weight. Describe the relationship between these two variables. source ( "http://www.openintro.org/stat/data/cdc.R" ) plot (cdc $ weight, cdc $ wtdesire, xlab = "weight" , ylab = "desired weight" ) #There seems to be a positive correlation. 2 Let’s consider a new variable: the difference between desired weight (wtdesire) and current weight (weight). Create this new variable by subtracting the two columns in the data frame and assigning them to a new object called wdiff. wdiff = cdc $ wtdesire - cdc $ weight This study source was downloaded by 100000794023742 from CourseHero.com on 07-17-2023 17:52:14 GMT -05:00 https://www.coursehero.com/file/63577898/Assignment-Lab1B-Intro-to-Data-Basics-IIdocx/
3 What type of data is wdiff? If an observation wdiff is 0, what does this mean about the person’s weight and desired weight. What if wdiff is positive or negative? #R shows that wdiff are integer values. #When wdiff is equal to 0 means the person's current weight is the same as their desired weight. #If wdiff > 0, means their weight is below their desired value. #Whereas wdiff < 0 implies that their current weight is above their desired weight. 4 Describe the distribution of wdiff in terms of its center, shape, and spread, including any plots you use. What does this tell us about how people feel about their current weight? hist (wdiff, breaks = 100 , main = "Difference between desired and current weight" ) #The distribution is peaked in the region of wdiff between 0 and -10 according to the histogram. This can imply that most people currently weighed more than their desired weight. This study source was downloaded by 100000794023742 from CourseHero.com on 07-17-2023 17:52:14 GMT -05:00 https://www.coursehero.com/file/63577898/Assignment-Lab1B-Intro-to-Data-Basics-IIdocx/
5 Using numerical summaries and a side-by-side box plot, determine if men tend to view their weight differently than women. summary (wdiff[cdc $ gender == "m" ]) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## -300.00 -20.00 -5.00 -10.71 0.00 500.00 summary (wdiff[cdc $ gender == "f" ]) ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## -300.00 -27.00 -10.00 -18.15 0.00 83.00 boxplot (wdiff ~ cdc $ gender, ylim = c ( - 300 , 500 ), ylab = "wdiff" ) boxplot (wdiff ~ cdc $ gender, ylim = c ( - 75 , 50 ), ylab = "wdiff" ) This study source was downloaded by 100000794023742 from CourseHero.com on 07-17-2023 17:52:14 GMT -05:00 https://www.coursehero.com/file/63577898/Assignment-Lab1B-Intro-to-Data-Basics-IIdocx/
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help