Hi all,

I hope to get some assistance in this. I have two datasets, x and y. I'm trying to fit dataset y to the distribution of dataset x. I have the shape, and rate of the distribution of dataset x, but not it's scale.

x  <- abs(rnorm(21))
y  <- abs(rnorm(21))

plot(density(x))
lines(density(y),col="red")
legend("topright",legend=c("x","y"),col=c("black","red"),lty=1,bty="n")

x1 <- fitdistr(x,"gamma")$estimate         # get scale and rate


--
Muhammad Rahiz

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to