I am running a linear regression model in R:
data(iris)
fit1.iris = lm(Sepal.Length ~ Petal.Length+Petal.Width , data=iris)
summary(fit1.iris)
These are my coefficients:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.19058 0.09705 43.181 < 2e-16 ***
Petal.Length 0.54178 0.06928 7.820 9.41e-13 ***
Petal.Width -0.31955 0.16045 -1.992 0.0483 *
I am trying to plot the density curve for parameter estimates, and below is how I did it for intercept. Am I doing it right ?
fit_iris = lm(Sepal.Length~ Petal.Length+Petal.Width , data=iris, x=TRUE, y=TRUE)
summary(fit_iris)
x_iris = seq(0, 10, length.out=1000)
plot(density(dnorm(x,4.190582,0.09705)), type='l')
normal-distribution
so I assume you know that each of the parameter estimates is assumed to be normally distributed. The normal distribution is parameterized by its mean and variance. Once you locate the means and variances of each of your parameter estimates, look into thednorm
function. $\endgroup$