Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- How to calculate a total score taken into account a given amount of mi...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 11-02-2018 12:33 PM
(1994 views)

Hey.

I am a new user of SAS enterprise guide and are doing calculations on forgotten joint score (FJS), which consists of 12 questions, each with a score of 0-4. This makes it possible to score between 0-48 which is converted to a scale from 0-100 by dividing with the number of answered questions and multiplied by 25.

Example with a person scoring 40 points after completing 10 questions (i.e. 2 missing data): (40 point/(12-2))*25=100

Example with a person scoring 38 points after completing same number (38points/(12-2))*25=95

My data consists of approximately 500 patients with different amount of missing data. In the score it is allowed to have missing data of up to 4 questions but not more than this.

I have already made my list with the patients who have a maximum of 4 missing data.

My question is: How do I make the sas-program which calculates the score depending on the number of missing data. Hence the examples above it has to divide by 12 minus the number of missing data in the equation.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@Jabjolsen wrote:

Hey.

I am a new user of SAS enterprise guide and are doing calculations on forgotten joint score (FJS), which consists of 12 questions, each with a score of 0-4. This makes it possible to score between 0-48 which is converted to a scale from 0-100 by dividing with the number of answered questions and multiplied by 25.

Example with a person scoring 40 points after completing 10 questions (i.e. 2 missing data): (40 point/(12-2))*25=100

Example with a person scoring 38 points after completing same number (38points/(12-2))*25=95

My data consists of approximately 500 patients with different amount of missing data. In the score it is allowed to have missing data of up to 4 questions but not more than this.I have already made my list with the patients who have a maximum of 4 missing data.

My question is: How do I make the sas-program which calculates the score depending on the number of missing data. Hence the examples above it has to divide by 12 minus the number of missing data in the equation.

Summary functions to the rescue

I think something similar to this is what you are looking for:

data want; set have; array s score1-score12; if nmiss(of s(*)) le 4 then fjs = ( sum(of s(*)) / n(of s(*)) )*25; run;

Score1 to score12 would be replaced by your question variables.

The NMISS function counts missing, the SUM function adds, and the N function counts non-missing.

The " of s(*) " says to use all of the elements of the array when calculating.

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@Jabjolsen wrote:

Hey.

I am a new user of SAS enterprise guide and are doing calculations on forgotten joint score (FJS), which consists of 12 questions, each with a score of 0-4. This makes it possible to score between 0-48 which is converted to a scale from 0-100 by dividing with the number of answered questions and multiplied by 25.

Example with a person scoring 40 points after completing 10 questions (i.e. 2 missing data): (40 point/(12-2))*25=100

Example with a person scoring 38 points after completing same number (38points/(12-2))*25=95

My data consists of approximately 500 patients with different amount of missing data. In the score it is allowed to have missing data of up to 4 questions but not more than this.I have already made my list with the patients who have a maximum of 4 missing data.

My question is: How do I make the sas-program which calculates the score depending on the number of missing data. Hence the examples above it has to divide by 12 minus the number of missing data in the equation.

Summary functions to the rescue

I think something similar to this is what you are looking for:

data want; set have; array s score1-score12; if nmiss(of s(*)) le 4 then fjs = ( sum(of s(*)) / n(of s(*)) )*25; run;

Score1 to score12 would be replaced by your question variables.

The NMISS function counts missing, the SUM function adds, and the N function counts non-missing.

The " of s(*) " says to use all of the elements of the array when calculating.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks a lot for a good answer.! I will check if it works soon.

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.