SDSS1 = read.table("baze//SDSS1.txt") podaci = SDSS1$V2 n = length(podaci) m = 308 h = diff(range(podaci))/m krajevi = min(podaci) + h*0:m histogram = hist(podaci, breaks = krajevi, probability = T, ylim = c(0, 70), main = "Histogram") alpha = 0.05 c = qnorm(1 - alpha/(2*m))*sqrt(m/n)/2 fn = histogram$density ln = (pmax(0, sqrt(fn) - c))^2 ln[length(ln) + 1] = ln[length(ln)] un = (sqrt(fn) + c)^2 un[length(un) + 1] = un[length(un)] # koordinatni sistem plot(min(podaci) + h*0:m, rep(0, m + 1), type = "n", xlab = "", ylab = "", main = "Traka poverenja", ylim = c(0, 80)) x = c(min(podaci) + h*0:m, rev(min(podaci) + h*0:m)) y = c(un, rev(ln)) polygon(x, y, col = 'grey', border = NA) lines(min(podaci) + h*0:m, ln, type = "s", col = "red") lines(min(podaci) + h*0:m, un, type = "s", col = "blue")