[R] Plot residuals against standard normal distribution
Hall, Mark
mehall at blm.gov
Tue Feb 3 01:01:59 CET 2015
Since you are plotting densities, check out the sm package. It has been
over a year or so since I've used it, but there was a setting on the
univariate densities to check the data against a normal distribution.
Best, MEH
On Mon, Feb 2, 2015 at 2:42 PM, Mikael Olai Milhøj <mikaelmilhoj at gmail.com>
wrote:
> Hi,
>
> I'm having trouble trying to plot the density of the residuals against the
> standard normal distribution N(0,1). (I'm trying to see if my residuals are
> well-behaved).
>
> I know hwo to calculate the standardized residuals (I guess that there may
> be a simple way using a R function) and then plot this by using the density
> function
>
> y<-(model$residuals-mean(model$residuals))/sd(model$residuals)
> plot(density(y))
>
> But I don't know how to add the N(0,1) curve. Any suggestions? Thanks in
> advance
>
>
> /Mikael
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Mark E. Hall, PhD
Assistant Field Manager, Black Rock Field Office
Winnemucca District Office
775-623-1529.
[[alternative HTML version deleted]]
More information about the R-help
mailing list