[R] Question re predict.glm & predict.lm in STATS

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Tue Feb 15 22:05:17 CET 2022


??
Show us the error. Show us the call.


On Tue, Feb 15, 2022, 12:14 PM STEPHEN KAISLER <skaisler1 using comcast.net>
wrote:

> Folks:
>
> I haved glm/lm to build a model on a training set derived from auto_mpg
> data of 274 records (70% sampling)
>
> The test data set has 118 records.
>
> I am trying to use predict.glm or predict.lm to predict the values of mpg
> from disp, hp,weight, accel, and cyl.
>
> However I get the following message:
>
>
> So, the resulting vector has 274 rows, when I believe it should have just
> 118 rows - the size of the test data set.
>
> I would appreciate it if someone could explain if am making the call
> in error.
>
> Steve Kaisler
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list