I am getting some very weird results. I have created a density plot for various continuous response variables, which are independent of each other.
I have noticed that the Density
value seems to be very small. I know the height is meaningless and what needs to be interpreted is the area under the curve. Therefore I have tried to check the area under my curve, but I have obtained value much smaller than 1 - namely -15411.15
:
strassenverkehr.densities <-plot(density.gs8m, ylim = c(0, 0.03), col = 9, lty = 1,
xlab = "Abweichung in %", xlim = c(-100,100) )
lines(density.ks12m, col=1, col = 7, lty = 8)
lines(density.bruecke4m, col = 2,lty = 3)
lines(density.bruecke8m, col = 3,lty = 4)
lines(density.bruecke12m, col = 4,lty = 5)
lines(density.FeldwegKies, col = 5,lty = 6)
lines(density.FeldwegAsph, col = 6,lty = 7)
> density.bruecke4m <- density (diff.bruecke4m)
> trapz(density.bruecke4m$x[density.bruecke4m$x < -40])
[1] -15411.45
I am afraid there is something seriously wrong with my analysis. Any ideas?