Hi, I have written this code and it is working fine
Example 1: >fit <- lm(cpi ~ year + quarter) >(cpi2011 <- fit$coefficients[[1]] + fit$coefficients[[2]]*2011 + >fit$coefficients[[3]]*(1:4)) ***************************************************************************************** Example 2: >fit <- lm(cpi ~ year ) >(cpi2011 <- fit$coefficients[[1]] + fit$coefficients[[2]]*2011) I'm getting an undesirable output for this calculation. Plz help in correcting the mistakes to get clear output. Regards, Swapnil Khobragade e-mail ID: swapnil.khobrag...@lntinfotech.com<mailto:swapnil.khobrag...@lntinfotech.com> Tel: @@@@@@@(Direct) | +91 9503043368 (M) ________________________________ The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail" [[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.