fittedvalues {lestat} | R Documentation |
Given a vector of data values and a design matrix, the fitted values for a linear model is computed.
fittedvalues(data, design)
data |
A data vector. |
design |
A design matrix. The number of rows must be equal to the length of the data vector. |
The fitted values represent the expected values all but the last variables in the posterior for the linear model.
A vector of values of length equal to the number of columns in the design matrix.
Petter Mostad <mostad@chalmers.se>
linearmodel
, leastsquares
,
linearpredict
xdata <- simulate(uniformdistribution(), 14)
ydata <- xdata + 4 + simulate(normal(), 14)*0.1
plot(xdata,ydata)
design <- cbind(1, xdata)
lines(xdata, fittedvalues(ydata, design))