Generating simple cross-tab in PROC FREQ
to exam possible trend of weight loss (in lb) in response to daily walking steps.
Weight_loss.xlsx: contains 19 participants/observations.
- Pid: participant id.
- Gender: participant gender.
- Weight0: weight at the beginning of the program.
- Weight1: weight at the end of 1st month of the program.
- Weight2: weight at the end of 2nd month of the program.
- walk_steps: walking steps daily.
- Import Excel data file into SAS, create SAS data set named as WL0.
- Data management:
- Check Data using
PROC MEANS
andPROC FREQ
. Create a new data set WL1 using a data step program including the following steps: step (i) and (ii). - Clean data: change value ‘9999’ to missing using Array statement.
- Create weight difference variables:
wd1 = weight0 - weight1; wd2 = weight0 - weight2; wd12 = weight1 - weight2;
- Using
PROC MEANS
andPROC FREQ
, check weight difference variables (only pick wd2 for this project, you may use others for practice) and walk_steps var for making groups from these var. Create a new data set WL2 using a data step program including the following steps: step (v) and (vi). - Create groups for walk_steps: create new var ws_group.
The new group var should have 3 categories:
- “less than 5000”
- “5000-10000”
- “greater than 10000”
- Create groups for wd2: create new var wd2_group
The new group var should have 3 categories:
- “not losing weight”
- “losing <= 5 lb”
- “losing > 5 lb”
- Check Data using
- Create permanent data set from data set WL2: projectd.weight_loss.
- Create cross-tab using
PROC FREQ
for walk steps' groups (ws_group) and weight loss groups (wd_group) to exam the possible trend.
This repository is structured as follows:
Weight-Loss-Analysis
├── Weight_Loss_Analysis.sas
├── Weight_loss.xlsx
├── README.md
└── LICENSE
- Weight_Loss_Analysis.sas: This SAS program file addresses all requirements in the weight loss analysis case study. It is the main file for conducting the data preparation and analysis based on the provided dataset.
- Weight_loss.xlsx: This Excel file contains the raw dataset that is imported and utilized in the SAS program for the weight loss analysis.
- README.md: This file provides an overview of the repository, including descriptions of the case study and relevant information for usage.
- LICENSE: The license file for the project.
Please note that the Weight_Loss_Analysis.sas program should be used as the primary entry point for conducting the weight loss analysis, and the Weight_loss.xlsx dataset serves as the input data for the analysis.
To run the TSA Claims Data Analysis program, you need an active account for either SAS® OnDemand for Academics or SAS® Viya. These platforms provide the necessary environment for executing SAS programs and analysing the data.
Follow the steps below to use the Weight Loss Analysis program:
- Download this repository to your local machine.
- Start SAS Studio from your SAS software.
- Within SAS Studio, create a new folder named data to store the dataset.
- Select the data folder and click on the Upload button.
- In the Upload File window, click Choose Files and browse to locate the Weight_loss.xlsx file on your computer. Select the file and click Open. Click Upload. The Weight_loss.xlsx file is added to the data folder on the SAS server. You should now have the dataset ready for use in the Weight_Loss_Analysis.sas program.
By following these steps, you can ensure that the necessary dataset is available for the Weight Loss Analysis program to run successfully.
This project is licensed under the MIT License.