Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the following R code where the dataset Fin has the variables SPY, X1, X2, X3 which of the following commands would generate the proper

In the following R code where the dataset Fin has the variables SPY, X1, X2, X3 which of the following commands would generate the proper mean squared error for the test sample:

attach(Fin) SubData=data.frame(SPY, X1, X2, X3) len=dim(Fin)[1] train=sample(len,*.7,replace=FALSE) full=lm(Y~.,data=SubData)

A) mean((Fin$SPY-predict(full,Fin))[-train]^2)

B) mean((Fin$SPY-predict(full,Fin))^2)

C) None of the other options

D) mean((Fin$SPY-predict(full,Fin))[train]^2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Abstract Analytic Number Theory

Authors: John Knopfmacher

1st Edition

0486169340, 9780486169347

More Books

Students also viewed these Mathematics questions

Question

The quality of the proposed ideas

Answered: 1 week ago

Question

The number of new ideas that emerge

Answered: 1 week ago