lambda <- c(0, 0.001, 0.005, 0.01, 0.02, 0.04, 0.08)
lridge <- ridge(Employed ~ GNP + Unemployed + Armed.Forces +
Population + Year + GNP.deflator,
data=longley, lambda=lambda)
criteria <- lridge$criteria |> print()
pridge <- precision(lridge) |> print()
plot(pridge)
# also show optimal criteria
plot(pridge, criteria = criteria)
# use degrees of freedom as point labels
plot(pridge, labels = "df")
plot(pridge, labels = "df", label.prefix="df:")
# show the trace measure
plot(pridge, yvar="trace")
Run the code above in your browser using DataLab