From: Chip Barnaby <cbarnaby_at_wrightsoft.com>

Date: Mon, 07 Apr 2008 17:57:08 -0400

* > lm<-lm( D$Y~D$X)
*

* > summary( lm)
*

Date: Mon, 07 Apr 2008 17:57:08 -0400

* > D<-data.frame( X=seq(1:10))
** > D$Y<-D$X+rnorm( 10)
** > D
*

1 1 0.3811634 2 2 1.8770049 3 3 3.5253376 4 4 3.1851957 5 5 3.8088813 6 6 5.7333074 7 7 7.4896623 8 8 7.9394056 9 9 8.6683570 10 10 10.7480675

Call:

lm(formula = D$Y ~ D$X)

Residuals:

Min 1Q Median 3Q Max -0.98812 -0.36354 -0.09808 0.48154 0.88288

Coefficients:

Estimate Std. Error t value Pr(>|t|) (Intercept) -0.58935 0.41680 -1.414 0.195 D$X 1.07727 0.06717 16.037 2.29e-07 ***

--- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6101 on 8 degrees of freedom Multiple R-Squared: 0.9698, Adjusted R-squared: 0.9661 F-statistic: 257.2 on 1 and 8 DF, p-value: 2.293e-07Received on Mon 07 Apr 2008 - 22:06:39 GMT

> DX<-data.frame( X=seq( 5.5, 11.5))

> DX

X 1 5.5 2 6.5 3 7.5 4 8.5 5 9.5 6 10.5 7 11.5

> predict.lm( lm, DX)

1 2 3 4 5 6 7 0.4879174 1.5651887 2.6424600 3.7197313 4.7970026 5.8742739 6.9515453 8 9 10 8.0288166 9.1060879 10.1833592 Warning message: 'newdata' had 7 rows but variable(s) found have 10 rows

>

--------------------------------------------------------- Chip Barnaby cbarnaby_at_wrightsoft.com Vice President of Research Wrightsoft Corp. 781-862-8719 x118 voice 131 Hartwell Ave 781-861-2058 fax Lexington, MA 02421 www.wrightsoft.com ______________________________________________ R-help_at_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.

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Mon 07 Apr 2008 - 23:30:26 GMT.

*
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help.
Please read the posting
guide before posting to the list.
*