predict.FSA: Prediction function for FSA solutions

Description Usage Arguments Value Examples

View source: R/predict.FSA.R

Description

Prediction function for FSA solutions

Usage

1
2
## S3 method for class 'FSA'
predict(object, ...)

Arguments

object

FSA object to conduct predictions on.

...

other parameters passed to fitmodels or predict functions. See help(fitmodels) or help(predict) for assistance.

Value

list of predicted values from each FSA model.

Examples

1
2
3
4
5
6
7
#use mtcars package see help(mtcars)
data(mtcars)
colnames(mtcars)
fit<-lmFSA(formula="mpg~hp*wt",data=mtcars,fixvar="hp",
             quad=FALSE,m=2,numrs=10,save_solutions=FALSE,cores=1)
predict(fit)
predict(fit,newdata=mtcars[1:15,])

Example output

 [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear"
[11] "carb"
There were 49 warnings (use warnings() to see them)
[[1]]
          Mazda RX4       Mazda RX4 Wag          Datsun 710      Hornet 4 Drive 
           23.09547            21.78138            25.58488            20.02924 
  Hornet Sportabout             Valiant          Duster 360           Merc 240D 
           17.28996            18.88542            15.40745            21.65887 
           Merc 230            Merc 280           Merc 280C          Merc 450SE 
           20.84992            18.55379            18.55379            15.14994 
         Merc 450SL         Merc 450SLC  Cadillac Fleetwood Lincoln Continental 
           16.23929            16.07909            12.02179            11.89490 
  Chrysler Imperial            Fiat 128         Honda Civic      Toyota Corolla 
           12.50221            27.84866            32.63195            30.24587 
      Toyota Corona    Dodge Challenger         AMC Javelin          Camaro Z28 
           24.56317            17.57441            17.91776            15.03111 
   Pontiac Firebird           Fiat X1-9       Porsche 914-2        Lotus Europa 
           15.93596            29.53900            26.71871            28.56630 
     Ford Pantera L        Ferrari Dino       Maserati Bora          Volvo 142E 
           15.36033            19.52990            13.54587            22.31363 

[[2]]
          Mazda RX4       Mazda RX4 Wag          Datsun 710      Hornet 4 Drive 
           23.09547            21.78138            25.58488            20.02924 
  Hornet Sportabout             Valiant          Duster 360           Merc 240D 
           17.28996            18.88542            15.40745            21.65887 
           Merc 230            Merc 280           Merc 280C          Merc 450SE 
           20.84992            18.55379            18.55379            15.14994 
         Merc 450SL         Merc 450SLC  Cadillac Fleetwood Lincoln Continental 
           16.23929            16.07909            12.02179            11.89490 
  Chrysler Imperial            Fiat 128         Honda Civic      Toyota Corolla 
           12.50221            27.84866            32.63195            30.24587 
      Toyota Corona    Dodge Challenger         AMC Javelin          Camaro Z28 
           24.56317            17.57441            17.91776            15.03111 
   Pontiac Firebird           Fiat X1-9       Porsche 914-2        Lotus Europa 
           15.93596            29.53900            26.71871            28.56630 
     Ford Pantera L        Ferrari Dino       Maserati Bora          Volvo 142E 
           15.36033            19.52990            13.54587            22.31363 

[[1]]
         Mazda RX4      Mazda RX4 Wag         Datsun 710     Hornet 4 Drive 
          23.09547           21.78138           25.58488           20.02924 
 Hornet Sportabout            Valiant         Duster 360          Merc 240D 
          17.28996           18.88542           15.40745           21.65887 
          Merc 230           Merc 280          Merc 280C         Merc 450SE 
          20.84992           18.55379           18.55379           15.14994 
        Merc 450SL        Merc 450SLC Cadillac Fleetwood 
          16.23929           16.07909           12.02179 

[[2]]
         Mazda RX4      Mazda RX4 Wag         Datsun 710     Hornet 4 Drive 
          23.09547           21.78138           25.58488           20.02924 
 Hornet Sportabout            Valiant         Duster 360          Merc 240D 
          17.28996           18.88542           15.40745           21.65887 
          Merc 230           Merc 280          Merc 280C         Merc 450SE 
          20.84992           18.55379           18.55379           15.14994 
        Merc 450SL        Merc 450SLC Cadillac Fleetwood 
          16.23929           16.07909           12.02179 

rFSA documentation built on July 1, 2020, 10:30 p.m.