Hello, I am trying to fit a model to some "death over time" data that does not fit the criteria for the usual LD50 type models (the counts are too large). I am using a simple linear model in an attempt to plot a nice line on a scatter plot and calculate some LD values to use in designing an experiment. Here is the basic idea of what I'm doing:
head(mort) Time Density 0 2233333333 0 2100000000 0 1933333333 5 1900000000 5 1433333333 5 900000000 plot(Density~Time) This plots something that looks a lot like a decay rate mod<-lm(log(Density)~Time) xv<-seq(0,60,0.1) yv<-exp(predict(mod,list(time=xv))) lines(xv,yv) Everything seems to work fine until I try to plot the lines, but then I get the error message: Error in xy.coords(x, y) : 'x' and 'y' lengths differ Checking the lengths of x and y confirms that somehow the object yv is not using xv to predict the data, and is only predicting as many data points as there are rows in the data frame. Any ideas on why this might be would be very much appreciated. Thank you, Julie [[alternative HTML version deleted]] ______________________________________________ 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.