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

Showing results for

Find a Community

- Home
- /
- BI
- /
- Enterprise Guide
- /
- PROC SGPANEL binwidth/binstart not applying

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-02-2017 01:57 PM

Hi Everyone,

I am trying to create some basic histograms using proc sgpanel and I am having trouble with the binwidth and binstart options. On some of the graphs I create, one panel will not follow the width and starting point specified. For example, I have four panels on a graph, three of which start at the point identified (1.25) with binstart and have the appropriate width (2.5), but the last one has widths twice as big (5) and starts at a different point (0).

Code:

```
proc sgpanel data = subjectlevel;
panelby class;
histogram score/ binwidth = 2.5 binstart = 1.25;
colaxis values = (0 to 50 by 5);
run;
```

Is there any way to fix this problem?

Thanks!

Accepted Solutions

Solution

11-02-2017
05:11 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bemiller

11-02-2017 05:11 PM - edited 11-02-2017 05:11 PM

I fixed it by adding 0.0001 to my binwidth. so my code went from

`proc sgpanel data = subjectlevel;`

panelby class;

histogram score/ binwidth = 2.5 binstart = 1.25;

colaxis values = (0 to 50 by 5);

run;

to

```
proc sgpanel data = subjectlevel;
panelby class;
histogram score/ binwidth = 2.5001 binstart = 1.25;
colaxis values = (0 to 50 by 5);
run;
```

...

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bemiller

11-02-2017 03:36 PM

You might look at the actual values of your score variable for the fourth value of the panelby variable.

I suspect some combination of values and intervals between values of the score variable are causing a problem.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

11-02-2017 03:52 PM

For all of the groups, the scores are whole numbers, and the fourth group specifically has 10% of the data from 0-2 (so where the first bin should be).

Solution

11-02-2017
05:11 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bemiller

11-02-2017 05:11 PM - edited 11-02-2017 05:11 PM

I fixed it by adding 0.0001 to my binwidth. so my code went from

`proc sgpanel data = subjectlevel;`

panelby class;

histogram score/ binwidth = 2.5 binstart = 1.25;

colaxis values = (0 to 50 by 5);

run;

to

```
proc sgpanel data = subjectlevel;
panelby class;
histogram score/ binwidth = 2.5001 binstart = 1.25;
colaxis values = (0 to 50 by 5);
run;
```

...