QuestionQuestion

You should submit two pdfs when completing this assignment. The first document should include your answers to the questions and any relevant SAS or R Output. The second document should include your SAS program code or R code. Make sure all questions are clearly labeled in each document.

1. The data set Grades.txt contains grades for a class of 30 students. Each observation consists of the student’s name, midterm score, final score, and homework score. Notice that the delimiter in the file is the ampersand (&).

a Import the data set into SAS using a DATA step. Print the data set and report the resulting output.
b Use PROC IMPORT to import the data set into SAS. Print the data set and report the resulting output.
c Import the data set into R and store it in a data frame. Report the resulting output.

You should submit two pdfs when completing this assignment. The first document should include your answers to the questions and any relevant SAS or R Output. The second document should include your SAS program code or R code. Make sure all questions are clearly labeled in each document.

1. The data set ‘NBAPlayer.txt’ is a comma delimited file that contains information on the NBA Players of the Week for the 2013-2014, 2014-2015, and 2015-2016 seasons. Variables include the date of the award, the name of the winning player, and the player’s age, conference, draft year, position, number of seasons in the league, team, weight (in lbs), and height (in in).
a Load the data set into SAS (you can treat the date of award variable as character data - we’ll discuss date data in Week 6). Print the resulting SAS data set and report your output. For now, it is okay if the entire names/values for character data are not displayed in your output.
b Load the data set into R and store it as a data frame. Report the first 5 lines of the resulting data frame.
2. The data below come from a study investigating a method of measuring body composition, and give the body fat percentage (% fat), age and sex for 18 adults aged between 23 and 61 years. Source: Mazess, R.B., Peppler, W.W., and Gibbons, M. (1984) Total body composition by dual-photon (153GD) ab- sorptiometry. American Journal of Clinical Nutrition, 40, 834-839.

age, % fat, sex
23 9.5 male
23 27.9 female
27 7.8 male
27 17.8 male
39 31.4 female
41 25.9 female
45 27.4 male
49 25.2 female
50 31.1 female
53 34.7 female
53 42.0 female
54 29.1 female
56 32.5 female
57 30.3 female
58 33.0 female
58 33.8 female
60 41.1 female
61 34.5 female
a Enter the data into SAS using a DATALINES statement in the DATA step. Use PROC PRINT to print the resulting data set. Report your output.
b Create a data frame in R for the body composition data (from part a). Print the data frame and report the output.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

1.

a)
Data grades;
Infile "/home/tpadmanin0/sasuser.v94/grades.txt" firstobs=2 DLM='&' DSD missover;
Input name$ midterm final homework
;
run;
Proc print data=grades;
run;

b)
proc import datafile = "/home/tpadmanin0/sasuser.v94/grades.txt" out=mydata dbms=dlm replace;
delimiter='&';
getnames=yes;
run;

proc print data=mydata;
run;

c)
setwd("C:/Users/sahas/Desktop/R projects")
grades<-read.table("grades.txt",header=TRUE, sep="&", stringsAsFactors=FALSE)
View(grades)
gr_table<- as.data.frame(grades)
print(gr_table)...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

50% discount

Hours
Minutes
Seconds
$31.50 $15.75
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Statistics-R Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats