Hi All, I would like to run a linear model where the response is the duration of relief in days and the regressor is the drug dosage in mg. Then I would like compute the predicted values of the duration of relief from the model and merge it into the original data. I am not sure how the merge happens since if I have missing values in the data, R runs the resgression model but fitted values for some observations are not being calculated.
Below is my R script Mydata<-read.csv(file=”file1.csv”, header=T) Model<-lm(y ~ x, data=Mydata) f<-fitted(Model) Newdata<-cbind(f , Mydata) Is Newdata merged correctly? Thanks for your help -- View this message in context: http://www.nabble.com/how-to-merge-the-fitted-values-from-a-linear-model--tp25248552p25248552.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.