search for: wrongmean

Displaying 1 result from an estimated 1 matches for "wrongmean".

2005 Nov 09
2
help with legacy R code
...= 12, quality = 75, bg = "white") myfunc <- function(x, mean, sd, nfalse, ntotal, shape, rate) { (nfalse*dgamma(x,shape,rate)+(ntotal-nfalse)*dnorm(x,mean,sd))/ntotal } wrong <- scan("wrongrawdata.txt", list(x=0)) wrongfit <- fitdistr(wrong$x, "gamma") wrongmean <- mean(wrong$x) wrongshape <- wrongfit[[1]][1] wrongrate <- wrongfit[[1]][2] good <- scan("rawdata.txt", list(x=0)) xmin = 0 newx = good$x xmean = mean(newx) xmax = max(newx)+0.15 goodhist <- hist(newx, br=seq(from=0,to=xmax,by=0.15), probability=T, col="li...