ruk·si

📊 R
Estimation

Updated at 2011-09-04 23:47

Creating basic estimations in R.

# LOESS curve
# degree : degree of polynomials fitted
# span : smoothness of the curve
# 1:length(prisoners$YHTEENSA),

plot(
    x= prisoners$VUOSI,
    y= prisoners$YHTEENSA,
    ylim= c(0,6000)
)
scatter.smooth(
    x= prisoners$VUOSI,
    y= prisoners$YHTEENSA,
    ylim= c(0,6000),
    degree= 2,
    span= 0.5,
    col= "#BBBBBB",
    xlab= "Year",
    ylab= "Prisoners",
    main= "Prisoners in Finland.",
    sub= "by Tommi Laine, source www.stat.fi"
)

plot(
    x= prisoners$VUOSI,
    y= prisoners$NAISET,
    ylim= c(0,6000)
)
scatter.smooth(
    x= prisoners$VUOSI,
    y= prisoners$NAISET,
    ylim= c(0,6000),
    degree= 2,
    span= 0.5,
    col= "#BBBBBB",
    xlab= "Year",
    ylab= "Prisoners",
    main= "Female Prisoners in Finland.",
    sub= "by Tommi Laine, source www.stat.fi"
)