Question: 1. Write data step(s) to convert the following wide dataset into a long dataset. i.e. transform the data from one record per subject to one

1.

Write data step(s) to convert the following wide dataset into a long dataset. i.e. transform the data from one record per subject to one record per visit. The output dataset should have 3 variables: id, visit, and value.

id d1 d2 d3 d4 d5

01 5.0 6.0 7.0 8.0 9.0

02 5.5 6.5 7.5 8.5 9.5

03 4.1 4.2 5.2 6.2 7.9

2.

Assume a SAS dataset /folders/myfolders/datalib/demo.sas7bdat contains variables - (type) : id (char), age (num), state (char).

Write SAS code which will calculate the average age by state.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!