BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ManitobaMoose
Quartz | Level 8

Hi,

 

For some reason my computed variable AveResponse is not showing up in my output. The log also shows a warning message stating that "AveResponse Not in the Report Definition". Q1-Q5 are quizzes with a score that ranges from 1 to 5. I am looking to display the average response for each ID of the 5 quizzes.

 

Everything looks ok as far as I can see. Anyone else have any ideas? Thanks.

-----------------------------

Libname Learn '/folders/myfolders/Learn' ;

Title "Report on the Survey Data Set" ;
Title2 ;
Title3 ;

proc report data=learn.survey nowd headline ls=80 ;
    columns Subj Gender Age Income Q1-Q5 ;
    define Subj      / display  "ID" width=5 ;
    define Gender    / display  width=5 ;
    define Age       / display  width=5 ;
    define Income    / display "Salary" width=5 format=dollar10. ;
    define Q1        / display  noprint ;
    define Q2        / display  noprint ;
    define Q3        / display  noprint ;
    define Q4        / display  noprint ;
    define Q5        / display  noprint ;
    Compute AveResponse ;
        AveResponse = mean of(Q1-Q5) ;
    EndComp ;
     define AveResponse / computed "Average Response" width=8 format=3.1 ;
run ;

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Adding AveResponse to the columns statement should fix the issue.

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

Adding AveResponse to the columns statement should fix the issue.

ManitobaMoose
Quartz | Level 8

Great! I just overlooked that.... Thanks!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2938 views
  • 4 likes
  • 2 in conversation