Plot partieller Regressions-Biplot der kleinsten Quadrate mit ggplot2

Verwendung derdata.frame unten (Quelle:http: //eric.univ-lyon2.fr/~ricco/tanagra/fichiers/en_Tanagra_PLSR_Software_Comparison.pd)

Date

df <- read.table(text = c("
diesel  twodoors    sportsstyle wheelbase   length  width   height  curbweight  enginesize  horsepower  horse_per_weight    conscity    price   symboling
0   1   0   97  172 66  56  2209    109 85  0.0385  8.7 7975    2
0   0   0   100 177 66  54  2337    109 102 0.0436  9.8 13950   2
0   0   0   116 203 72  57  3740    234 155 0.0414  14.7    34184   -1
0   1   1   103 184 68  52  3016    171 161 0.0534  12.4    15998   3
0   0   0   101 177 65  54  2765    164 121 0.0438  11.2    21105   0
0   1   0   90  169 65  52  2756    194 207 0.0751  13.8    34028   3
1   0   0   105 175 66  54  2700    134 72  0.0267  7.6 18344   0
0   0   0   108 187 68  57  3020    120 97  0.0321  12.4    11900   0
0   0   1   94  157 64  51  1967    90  68  0.0346  7.6 6229    1
0   1   0   95  169 64  53  2265    98  112 0.0494  9.0 9298    1
1   0   0   96  166 64  53  2275    110 56  0.0246  6.9 7898    0
0   1   0   100 177 66  53  2507    136 110 0.0439  12.4    15250   2
0   1   1   94  157 64  51  1876    90  68  0.0362  6.4 5572    1
0   0   0   95  170 64  54  2024    97  69  0.0341  7.6 7349    1
0   1   1   95  171 66  52  2823    152 154 0.0546  12.4    16500   1
0   0   0   103 175 65  60  2535    122 88  0.0347  9.8 8921    -1
0   0   0   113 200 70  53  4066    258 176 0.0433  15.7    32250   0
0   0   0   95  165 64  55  1938    97  69  0.0356  7.6 6849    1
1   0   0   97  172 66  56  2319    97  68  0.0293  6.4 9495    2
0   0   0   97  172 66  56  2275    109 85  0.0374  8.7 8495    2"), header = T)

und da

Cod

library(plsdepot)
df.plsdepot = plsreg1(df[, 1:11], df[, 14, drop = FALSE], comps = 3)
plot(df.plsdepot, comps = c(1, 2))

Ich schaff da

Ergebni

Die abhängige (y) Variable ist hiersymboling ist wie der Preis die Funktion aller anderen unabhängigen Variablen für die Autos diesel, twodoors, sportsstyle, wheelbase, length, width, height, curbweight, enginesize,horsepower, horse_per_weight)

Frag

Jede Hilfe zum Erstellen des obigen Diagramms mitggplot2 aber mit Pfeilen anstelle von Linien, die diesem @ ähnlich siHandlun wird sehr geschätzt?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage