https://github.com/maxinexiong/weight_loss_analysis
This SAS case study aims to generate simple cross-tab in Proc Freq to exam possible trend of weight loss (in lb) in response to daily walking steps. The program effectively addresses the data requirements, enabling quick analysis on the relationship between weight loss and daily walking steps.
https://github.com/maxinexiong/weight_loss_analysis
case-study sas sas-base-cert sas-programming sas-studio
Last synced: about 2 months ago
JSON representation
This SAS case study aims to generate simple cross-tab in Proc Freq to exam possible trend of weight loss (in lb) in response to daily walking steps. The program effectively addresses the data requirements, enabling quick analysis on the relationship between weight loss and daily walking steps.
- Host: GitHub
- URL: https://github.com/maxinexiong/weight_loss_analysis
- Owner: MaxineXiong
- License: mit
- Created: 2023-07-01T18:21:36.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-02T13:48:02.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T07:38:02.377Z (3 months ago)
- Topics: case-study, sas, sas-base-cert, sas-programming, sas-studio
- Language: SAS
- Homepage: https://maxinexiong.github.io/dark-mode/projects/sas.html#sas-ws
- Size: 17.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SAS Case Study: Weight Loss Analysis
[](https://github.com/MaxineXiong)
[](https://opensource.org/licenses/MIT)
[](https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/whatsnew/p07ec8vqwrr6i9n1ptnai8ui5ebo.htm)
## Case Study Descriptions
### **Objective**
Generating simple cross-tab in `PROC FREQ` to exam possible trend of weight loss (in lb) in response to daily walking steps.
### **Data**
**Weight_loss.xlsx**: contains 19 participants/observations.
### Variables
- **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.### **Steps**
- Import Excel data file into SAS, create SAS data set named as **WL0**.
- Data management:
1. Check Data using `PROC MEANS` and `PROC FREQ`. Create a new data set **WL1** using a data step program including the following steps: step (i) and (ii).
2. Clean data: change value ‘9999’ to missing using Array statement.
3. Create weight difference variables:
```
wd1 = weight0 - weight1;
wd2 = weight0 - weight2;
wd12 = weight1 - weight2;
```
4. Using `PROC MEANS` and `PROC 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).
5. 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”
6. 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”
- 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.
## **Repository Structure**
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.
## Prerequisites
To run the TSA Claims Data Analysis program, you need an active account for either [**SAS® OnDemand for Academics**](https://welcome.oda.sas.com/) or **[SAS® Viya](https://www.sas.com/en_au/software/viya.html)**. These platforms provide the necessary environment for executing SAS programs and analysing the data.
## **Usage**
Follow the steps below to use the Weight Loss Analysis program:
1. Download this repository to your local machine.
2. Start **SAS Studio** from your SAS software.
3. Within SAS Studio, create a new folder named **data** to store the dataset.
4. Select the **data** folder and click on the **Upload** button.
5. 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.
## **License**
This project is licensed under the **[MIT License](https://choosealicense.com/licenses/mit/)**.