[R] undesirable output for lm( )

Swapnil Khobragade Swapnil.Khobragade at lntinfotech.com
Tue Oct 21 12:33:29 CEST 2014


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.khobragade at lntinfotech.com<mailto:swapnil.khobragade at 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]]



More information about the R-help mailing list