How to create Histogram density plot in SAS but with already predicted and observed values?

194 Views Asked by At

I'm working on a paper that characterize the tree diameter distribution using Weibull. I have tested some parameter prediction and parameter recovery methods and I obtained the results. My results consist of the observed number of trees per hectare and predicted number of trees per hectare by pre-determined diameter classes (i.e. 5 cm, 10 cm, 15 cm....etc). A sample data structure can be like:

dclass  nd      ndhat10
15      24.1    51.3
20      72.3    130.9
25      120.5   178.8
30      144.6   169.5
35      72.3    118.5
40      144.6   62.3
45      72.3    24.6
50      24.1    7.3
55      48.2    1.6
60      24.1    0.3

where dcalss is the diameter classes, nd is observed number of tree per hectare and ndhat10 is the predicted number of tree per hectare.

Basically I want to create a Histogram density like plot showing how good the predicted values represent the actual values. Actual values should be in bars and the predicted values should be in a continuous line. What I get is like enter image description here

with the following code:

proc sgplot data=sonuc;
by plot;
vbar dclass / response=nd;
vline dclass / response=ndhat10;
run;
quit;

But I want get a plot more like this enter image description here

Don't mind the SVR Model in the example.

I tried histogram options in SAS but it gives me the percent not the actual observed or predicted values. Beside vline option creates jagged line not a smooth one like in density curves. By the way I know just a little bit of R. Creating these plots in SAS is not mandatory for me. A piece of R code that creates the plots I want is also works for me. Thanks in advance.

0

There are 0 best solutions below