BookmarkSubscribeRSS Feed
jasmine_humber
Calcite | Level 5

I am working on a group project for class and all 8 of us are stuck on this. I can send what we have so far but it isn't even showing us a table for either on SAS. Please help us out! We are stuck and just need the answers to understand. 

 

Task 1 –

Working with survey data. A study on weight loss in males was conducted over a five-month period. Participants came to a clinic at the beginning of each month, and their weight, as well as their responses to six survey questions regarding weight loss, were obtained. The raw data file WLSurveys.dat contains variables for subject ID, height (in), weight (Ib) at each of five visits, and responses to questions 1-6 at each of five visits. Note that the first six survey responses and from visit one, the next six survey responses are from visit two, and so on for a total of 30 survey responses.

a. Examine the raw data file WLSurveys.dat and read it into SAS. The raw data file is tab delimited and saved at (I:\DropBoxes\n01018551\Pickup\MkTG4552\GroupProject2\WLSurveys.dat) DLM=’09’x in INFILE statement

b. The survey questions were measured on a scale of 0(least) to 3(most). However, the data were recorded inconsistently by data entry clerks; and questions 2,3, and 5 (for every visit) were accidentally recorded in the reverse order (0=most and 3=least). Convert questions 2, 3, and 5 for every visit so that they are measured in the same direction as the other questions.

c. Missing data were coded as -99. Reclassify these values as a period (.) to signify missing numeric data in SAS.

d. Calculate the subject’s body mass index at each of the five visits as weight (Ib) divided by height (in) squared, and then multiplied by 703.

e. Researchers would like to study the subjects that are classified as overweight or obese at the final visit. Limit the resulting data set to those patients with a final visit body mass index that is 25.0 or more.

f. View the resulting data set. In comment in your program, find the tenth observation and state the subject ID, number of question variables with missing values, and the BMI at the last visit.

 

Task 2 -

Using Basic Statistic Procedures Each Year, Forbes magazine publishes a list of the world’s 100 biggest companies. Each company receives a score using four metrics: sales, profits, assets, and market value. The final overall ranking is based on a composite score of these metrics. The SAS data set called BIGCOMP includes variables for ranking, company name, and these four metrics.

a) Examine this SAS data set including the variable labels and attributes. Use a procedure to calculate the mean, standard deviation, median, minimum, maximum, and sample size of assets for United States versus non-United States companies.

 

 

 

 

 

1 REPLY 1
ChrisHemedinger
Community Manager

Sounds like your first task - reading the tab-delimited file -- isn't complete yet.

 

SAS can read these files using a couple of methods:

  • PROC IMPORT using DBMS=TAB, example here.  Simple, but limited in flexibility.
  • Using DATA step with INFILE, which is probably what your teacher prefers/assumes you'll use.  You get more control that way, especially if you need to adjust for data quality issues -- which sounds like some of your tasks.

 

You should be able to find many example of using DATA step with INFILE and tab-delimited files (DLM='09'x).  Here's a SAS note on that.

 

You might also watch this tutorial -- it covers CSV, but the concepts are similar.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1127 views
  • 2 likes
  • 2 in conversation