0
AS1 = lm(GPA ~ Sex + Fulltime + Indigenous + Co.op + International, data = data11)

I made a regression like this.

        GPA      Sex       Fulltime  Indigenous  Co-op     International
2015/16 2.738711 0.1957311 0.5429625 0.008433362 0.4104236 0.2378208    
2016/17 2.799184 0.1922954 0.5640596 0.01018903  0.420968  0.2330071    
2017/18 2.842297 0.2017633 0.5600541 0.008940075 0.4422708 0.2392785    
2018/19 2.858647 0.2008524 0.5799423 0.007858447 0.4233421 0.2367674    
2019/20 NA       0.2011515 0.5712549 0.007988816 0.4156681 0.242161  

And this is my data set that is data11. I want to predict 2019/20 GPA which is empty right now by using the linear regression which is AS1.

AS1P = predict(AS1, newdata = data11[5, ])
prediction from a rank-deficient fit may be misleading

This is a function that I used to predict. And it said it is misleading. If anyone that can help me, I would be appreciate!!

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
somi gim
  • 17
  • 4
  • 1
    Just for kicks, try `predict(AS1, newdata = data11[5, , drop = FALSE])`. Might help if `data11` is a matrix, not a data frame. – Gregor Thomas Dec 07 '20 at 03:52
  • It kept saying that misleading :( `data11` is actually csv file! – somi gim Dec 07 '20 at 03:54
  • What happens with `predict(AS1)`? The object `data11` is a data frame that you created by reading a .csv file using `read.csv()` or another similar function. Use `dput(data11)` and paste that into your question. If that is too much data, then use `dput(data11[1:15, ])`. It is not clear if "2019/20" is an unlabeled column or a row name. – dcarlson Dec 07 '20 at 04:49
  • @somigim I explained this to you in my answer to your [last question](https://stackoverflow.com/questions/65167566/can-i-make-a-simple-regression-from-matrix). You get this error because you have more predictors than observations. if you had only three predictors for your 4 observations you already get a perfect fit. You can't use five predictors on 4 observations without getting the warning you are getting. It "may be misleading" simply because you are over-fitting your model. You cannot be confident about the estimate for the fifth row because you are basing it on only 4 observations. – Allan Cameron Dec 07 '20 at 09:10
  • Well, you may have imported `data11` from a CSV file, but once it's in R it is an R object with an R class. Look at `class(data11)` to find out what it is. – Gregor Thomas Dec 07 '20 at 13:07

0 Answers0