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

Hello,

  I have 2 Variables:  Star, bin_NAV.   

   - Star is the ordinal scale where its data included  2-star, 3-star, 4-star and 5-star.

   - bin_NAV  is the ordinal scale where its data included  1, 2, 3, 4 and 5.

      (bin_NAV is created from proc hpbin to bin the ratio scale variable, NAV, into 5 classes)

I want to build histogram classify by Star by the following procedure.

Capture.PNG

The histogram show the value of bin_nav at 0 and 6, which are not in the data.  (See figure below)

What wrong is the code?

Thank You.

Capture2.PNG

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

UNIVARIATE doesn't know that you think the values of BIN_NAV are categories. It sees a numeric variable, considers it to be continuous, and bins them according to its default rule. You want to use the MIDPOINTS= option of the HISTOGRAM statement.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

UNIVARIATE doesn't know that you think the values of BIN_NAV are categories. It sees a numeric variable, considers it to be continuous, and bins them according to its default rule. You want to use the MIDPOINTS= option of the HISTOGRAM statement.

--
Paige Miller
Golf
Quartz | Level 8
Thank You for your help.
Golf

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 370 views
  • 0 likes
  • 2 in conversation