dr.directions.Rd
Dimension reduction regression returns a set of up to \(p\) orthogonal direction vectors each of length \(p\), the first \(d\) of which are estimates a basis of a \(d\) dimensional central subspace. The function returns the estimated directions in the original \(n\) dimensional space for plotting.
a dimension reduction regression object created by dr.
select the directions wanted, default is all directions.
If method is ire
, then the directions depend on the value of the
dimension you select. If omitted, select all directions.
The number of basis vectors to return
select the X matrix, the default is dr.x(object)
Dimension reduction regression is used to estimate a basis of the central
subspace or mean central subspace of a regression. If there are \(p\)
predictors, the dimension of the central subspace is less than or equal to
\(p\). These two functions, dr.basis
and dr.direction
,
return vectors that describe the central subspace in various ways.
Consder dr.basis
first. If you set numdir=3
, for example, this
method will return a \(p\) by 3 matrix whose columns span the estimated
three dimensional central subspace. For all methods except for ire
,
this simply returns the first three columns of object$evectors
. For
the ire
method, this returns the three vectors determined by a
three-dimensional solution. Call this matrix \(C\). The basis is
determined by back-transforming from centered and scaled predictors to
the scale of the original predictors, and then renormalizing the vectors
to have length one. These vectors are orthogonal in the inner
product determined by Var(X).
The dr.direction
method return \(XC\), the same space but now a
subspace of the original \(n\)-dimensional space. These vectors are
appropriate for plotting.
Both functions return a matrix: for dr.direction
, the matrix has n rows and
numdir columns, and for dr.basis
it has p rows and numdir columns.
See R. D. Cook (1998). Regression Graphics. New York: Wiley.
data(ais)
#fit dimension reduction using sir
m1 <- dr(LBM~Wt+Ht+RCC+WCC, method="sir", nslices = 8, data=ais)
summary(m1)
#>
#> Call:
#> dr(formula = LBM ~ Wt + Ht + RCC + WCC, data = ais, method = "sir",
#> nslices = 8)
#>
#> Method:
#> sir with 8 slices, n = 202.
#>
#> Slice Sizes:
#> 25 25 25 25 27 27 30 18
#>
#> Estimated Basis Vectors for Central Subspace:
#> Dir1 Dir2 Dir3 Dir4
#> Wt -0.11412 -0.016473 -0.3759 0.01182
#> Ht -0.05112 -0.003916 0.6108 -0.04842
#> RCC -0.99086 0.999513 -0.4675 0.12609
#> WCC 0.05060 -0.026227 0.5167 0.99077
#>
#> Dir1 Dir2 Dir3 Dir4
#> Eigenvalues 0.8769 0.1592 0.04233 0.01313
#> R^2(OLS|dr) 0.9987 0.9988 0.99997 1.00000
#>
#> Large-sample Marginal Dimension Tests:
#> Stat df p.value
#> 0D vs >= 1D 220.484 28 0.000000
#> 1D vs >= 2D 43.354 18 0.000713
#> 2D vs >= 3D 11.201 10 0.342038
#> 3D vs >= 4D 2.651 4 0.617748
dr.basis(m1)
#> Dir1 Dir2 Dir3 Dir4
#> Wt -0.11412498 -0.016473110 -0.3759166 0.01182273
#> Ht -0.05111519 -0.003915546 0.6108368 -0.04842039
#> RCC -0.99085957 0.999512606 -0.4675317 0.12609498
#> WCC 0.05059675 -0.026227005 0.5167003 0.99076523
dr.directions(m1)
#> Dir1 Dir2 Dir3 Dir4
#> 1 0.480092632 0.894468399 8.742678217 0.42677297
#> 2 0.055025430 0.367263950 6.850085574 -0.66958608
#> 3 -1.258670545 0.416680753 -0.005392142 2.12044267
#> 4 -0.273621084 0.578270203 2.381352807 2.10705092
#> 5 -1.208557361 0.106537174 6.625048524 0.68043674
#> 6 -2.078459509 0.337091184 -0.587941442 2.59979087
#> 7 0.020126554 0.388008270 2.908075668 2.13638957
#> 8 -1.997158240 0.027496794 0.338274681 1.27831342
#> 9 -1.921322532 0.291154476 -0.997038441 -2.04286832
#> 10 -1.461927444 -0.062785750 3.125041008 2.84323041
#> 11 3.192536898 0.363977782 -0.812751724 2.18511878
#> 12 0.388124986 0.145344172 5.210858546 0.23327382
#> 13 -2.333125503 0.145667498 -1.678002034 -1.02931866
#> 14 0.105652823 0.516396656 -3.665820840 0.78645591
#> 15 -0.588005703 -0.011787240 -0.728049861 1.02735478
#> 16 -0.829376523 0.247879921 0.878334198 1.37069447
#> 17 -0.956125184 0.788134927 1.887221776 -0.00831735
#> 18 -1.007552923 0.134260500 2.837688773 -1.09900991
#> 19 0.491654436 0.484865066 1.723590013 -0.75639964
#> 20 -0.193633763 -0.232477472 -1.112887011 0.07301998
#> 21 -0.284065516 0.210023736 -0.907006352 1.39534446
#> 22 -0.769719967 0.655993966 -4.690318128 3.63316744
#> 23 -1.317868608 0.206568412 -0.301397336 -2.56707784
#> 24 -0.484553481 -0.449114426 4.681137633 0.92064128
#> 25 0.382174836 0.519353079 0.581922607 1.52147883
#> 26 -0.335714653 0.196099228 -0.070598336 1.54863979
#> 27 -0.061054463 0.585211272 -1.744173298 1.32801931
#> 28 -0.462091200 0.225184921 -2.143021450 -0.65659098
#> 29 -4.632725591 0.008992454 -4.807421118 -1.19268285
#> 30 -1.033274341 0.004994170 2.495121182 0.59545939
#> 31 -0.801508868 -0.315174090 3.435625672 0.82807568
#> 32 -0.539110384 0.342901299 1.573176390 -2.94945204
#> 33 0.050892672 0.301360145 -2.034935140 0.44298671
#> 34 0.370019604 0.358573847 -0.949529510 1.27995960
#> 35 0.855538370 -0.064511960 2.500217546 0.05007295
#> 36 -2.363527618 0.059101445 6.934452930 -6.09551992
#> 37 -2.261320092 0.312065821 -0.376627439 0.94874912
#> 38 -1.781962211 0.411708024 1.281738222 -0.51212189
#> 39 -2.513611142 0.104179352 -1.034078964 0.42746411
#> 40 -0.678942787 0.600582024 2.193239084 1.54477773
#> 41 -1.450648070 0.447319197 1.267763465 1.06667825
#> 42 -1.437102326 0.358380626 0.276630023 2.11136600
#> 43 -1.295018898 0.866356277 -3.159389924 0.33982150
#> 44 -1.779719932 0.578435432 -1.890075962 1.45503197
#> 45 -1.443027195 0.219098224 -0.108816077 -2.76895919
#> 46 -0.659622058 0.539272618 1.046420917 -3.47395755
#> 47 -1.475131545 0.684190102 4.777186530 1.14912144
#> 48 -1.656099550 0.645665930 -0.245987081 -2.10183316
#> 49 -0.914506663 0.350545108 -2.336210444 -2.74442427
#> 50 -3.320413045 -0.279871854 0.714682286 1.73133344
#> 51 -1.061690302 0.523714772 -1.312391538 -3.78390073
#> 52 -0.738673764 0.330188240 -0.160742823 -3.91405749
#> 53 -0.511970816 0.390972597 -4.596299340 -2.54664445
#> 54 -0.747616932 -0.200865793 5.248908932 -1.07189474
#> 55 0.550021248 0.629282621 -2.942453653 0.18358110
#> 56 0.345541594 0.641061321 -2.261339332 -1.32708151
#> 57 -2.006506242 0.573233790 3.889248542 0.70544670
#> 58 -1.885087648 0.590418549 -1.777637921 -1.62577389
#> 59 -1.955415731 0.108525849 -2.997984805 1.27047787
#> 60 -2.924928610 0.313331269 -0.475404341 0.97931115
#> 61 -0.743499119 0.444063979 0.450421537 2.31100321
#> 62 -0.814549091 0.497483593 -3.637922381 -1.25701759
#> 63 -1.065872630 0.204437141 -1.941097626 -1.42483294
#> 64 -0.829298051 0.220192946 2.024888360 1.44541930
#> 65 -1.841975890 0.158008010 0.314560690 1.72767806
#> 66 -2.878225871 -0.210506347 0.554847140 1.77707631
#> 67 -3.062584436 0.279105598 -3.365186518 -0.37202098
#> 68 -2.825172521 -0.019307899 1.446778046 -2.63700398
#> 69 -1.018326369 -0.721696677 1.166683963 -2.61266742
#> 70 1.093607416 0.290018506 -8.424953899 0.91923337
#> 71 0.090084266 -0.070581764 -7.165166876 -0.18769774
#> 72 0.333922755 0.375601853 -6.790410632 -2.31119379
#> 73 0.710376649 0.059131928 -5.708764506 -0.30810041
#> 74 -0.009165469 -0.596932028 -4.119489551 -2.65276773
#> 75 1.871140421 0.274369000 -12.019494130 -1.00354465
#> 76 -4.002993249 0.154113859 4.768428826 -0.22915268
#> 77 -1.587366010 -0.252650132 3.876925758 -0.43891808
#> 78 -3.802549884 0.019376590 -2.908955336 -0.36019345
#> 79 -2.170053514 0.015608648 -3.961118303 0.54820108
#> 80 -3.942971339 0.065673182 -2.782174987 0.05439748
#> 81 -1.592908191 -0.194864074 -2.099937627 -0.12671948
#> 82 -4.212628493 0.145613505 -1.457338226 0.23822802
#> 83 -3.185261926 0.118498113 -1.936399888 0.09559846
#> 84 -2.677618285 0.525837499 2.944850372 1.18037038
#> 85 -2.454063595 -0.397481687 -4.087275347 -1.10793035
#> 86 -3.311217612 -0.008271154 4.148711204 0.27820761
#> 87 -1.859408866 -0.313292448 3.881749966 -0.06628332
#> 88 -2.257507063 -0.751650739 -0.379218591 -1.51363455
#> 89 -1.958583456 -0.518683808 1.081671422 -0.92688113
#> 90 -1.589053912 0.536402470 -7.302782178 2.42297175
#> 91 -0.897309870 0.139289672 -1.052451698 3.05680346
#> 92 -3.433282032 -0.021202243 -3.078056532 -1.37017576
#> 93 -2.582987301 0.366077443 0.619277788 0.38073778
#> 94 -3.541074707 -0.787121078 1.702362777 0.34653849
#> 95 -1.997466451 -0.771883964 3.868630311 -0.16855704
#> 96 -4.490563422 -0.528090827 -2.921924496 -0.02029417
#> 97 -4.808453826 0.046732078 -1.499760092 -2.51224421
#> 98 -4.827904868 -0.471733762 -3.443529490 1.35839457
#> 99 -6.352494829 -0.164733945 -5.920680608 1.19652615
#> 100 -5.263182406 -0.334587339 -7.983022905 -0.41269693
#> 101 -0.884322689 -0.572322832 -1.709020771 -0.30711459
#> 102 -0.168116339 -0.122575458 -1.771013878 -0.66815944
#> 103 1.127698894 -0.352337762 -1.262555012 2.42907619
#> 104 2.755863747 -0.268318245 2.271045983 3.46849378
#> 105 2.057245489 -0.209965261 4.535348223 0.89894041
#> 106 0.655330097 -0.261800765 -1.216073852 -0.06140221
#> 107 1.141458337 -0.569545597 -0.209685332 1.12744909
#> 108 1.295106891 0.187594118 -0.620350637 -1.41100510
#> 109 2.391372213 -0.425449011 3.497460240 0.92093354
#> 110 2.568721197 0.095831503 -3.316653912 2.41095752
#> 111 0.587335605 -0.690895063 2.064756704 2.02976824
#> 112 1.656662236 0.063056698 3.750044323 1.37027434
#> 113 2.771827836 0.725697920 -3.205175065 3.07270625
#> 114 1.856608008 0.094927140 2.946330462 -0.71368970
#> 115 1.591547872 -0.143630003 -3.025192933 -0.07267874
#> 116 1.369308144 0.472653194 0.351997701 2.10731427
#> 117 3.315565068 0.111717764 3.247476607 1.81623428
#> 118 1.597070301 0.213450334 0.272337426 -2.03276374
#> 119 2.581860429 -0.240293902 2.031060615 0.66744583
#> 120 2.103789509 -0.244916492 -0.793108170 -1.22065407
#> 121 -2.689123844 -0.884454760 -1.600511153 0.07878895
#> 122 2.659823995 -0.423961883 -2.681367494 0.31113411
#> 123 2.577200982 0.053814260 -1.592179123 1.90799079
#> 124 2.727617243 -0.234907434 2.970754825 0.02963995
#> 125 2.471000695 0.013618918 -1.771113034 -2.94885854
#> 126 3.467844790 0.252398000 -0.554003055 2.51704551
#> 127 2.661500829 -0.256660295 -0.820951917 1.29461953
#> 128 1.860602788 0.280606111 0.389828320 -0.65081130
#> 129 3.511452544 -0.156063517 5.738302733 0.62325042
#> 130 1.105076877 0.270438551 7.278287223 1.90981003
#> 131 2.934430277 -0.138801788 1.932320348 1.74160692
#> 132 2.066554827 -0.063898493 -0.088533768 0.60511916
#> 133 6.315338821 0.324295751 3.599715131 0.02105968
#> 134 3.964743140 0.308924673 5.709143219 0.44684342
#> 135 3.503126990 0.761158274 3.071921655 -1.44186627
#> 136 0.918820466 0.009658659 3.181288353 -0.90881358
#> 137 1.914508743 0.951803400 5.528715085 -1.08261935
#> 138 0.748955670 -0.075850857 2.730453477 -0.04922947
#> 139 1.800056118 0.076265209 3.999053602 1.19895619
#> 140 0.859726331 0.045112632 8.819849137 1.12859504
#> 141 -2.295010850 -0.152781249 -2.031884323 1.20305867
#> 142 -0.138542301 -0.029586305 5.525977949 0.27252126
#> 143 0.053233696 -0.242292092 3.830216761 0.02972080
#> 144 1.039413994 -0.423189586 3.694491823 -0.12243336
#> 145 3.693059028 0.151509082 -6.606104219 -1.90710685
#> 146 2.733548462 0.012246173 -2.832934834 -2.48389419
#> 147 0.960996519 -0.157950058 0.907660178 0.95831162
#> 148 -1.029553829 -0.331014647 -0.445531493 0.63437827
#> 149 -0.269227180 0.207934394 3.237409147 2.91785323
#> 150 0.324485790 -0.225391555 -1.098432011 3.20705173
#> 151 -0.892815519 -0.269909714 0.940228407 -2.01622763
#> 152 -1.450098206 -0.430894115 2.392562380 -0.25501045
#> 153 -2.292570681 0.195285227 0.431950176 2.52002622
#> 154 1.270268590 -0.323942309 5.019494453 1.44938794
#> 155 -2.640463126 -0.133655181 0.639200425 0.79427402
#> 156 -0.487753533 -0.288963020 -3.128468665 1.02206950
#> 157 0.032503624 -0.569898690 0.029959604 3.08839554
#> 158 0.812551211 -0.155725076 -4.458144054 2.62333002
#> 159 1.793786202 -0.061285382 3.205091480 -0.73171611
#> 160 5.273423639 -0.209799766 -12.304219215 2.19748909
#> 161 2.340472574 -1.100786811 2.361846573 0.91282603
#> 162 2.810414390 0.132821432 -7.818486175 -2.08237210
#> 163 6.765239930 0.044638746 -13.385391341 0.67493986
#> 164 0.259005106 -0.432257847 2.778040334 -1.18928450
#> 165 1.039854052 0.282916179 1.611264755 -1.67295450
#> 166 1.819309801 -2.006322995 -4.454212718 -0.50630305
#> 167 -0.330209740 -0.193699231 1.607608054 0.56487349
#> 168 -0.388548432 -0.744357943 2.017493263 -0.54447913
#> 169 -0.491421284 -0.600474840 -3.644537008 2.15831460
#> 170 -0.850324377 -0.154631793 1.570019596 2.36673977
#> 171 -0.420444298 -0.427122081 -2.785090342 1.64235088
#> 172 -0.323517258 -0.346418154 0.217055810 -0.17683613
#> 173 0.286070901 -0.875017169 -0.458185373 1.06995683
#> 174 -0.300903491 -0.982005260 -3.155321439 -1.25034675
#> 175 -1.155112188 -0.532272431 2.858075297 0.50597878
#> 176 3.528676736 -0.438333984 -2.676454835 0.80518841
#> 177 3.294711621 0.048907567 2.927768698 -1.71144072
#> 178 3.915601597 0.332818346 -12.587907328 -1.65180272
#> 179 2.810414390 0.132821432 -7.818486175 -2.08237210
#> 180 0.303424990 -0.348272601 0.259308458 -1.65266277
#> 181 0.475755930 -0.898688621 -1.769522991 -4.03893566
#> 182 2.645557368 0.506266998 1.549951090 -1.57876805
#> 183 0.116735871 -0.095378436 0.606289324 -3.13875820
#> 184 3.346002645 0.171490932 3.317678831 0.19261244
#> 185 1.879378815 -0.350722989 -1.418001631 -2.94960624
#> 186 1.199767105 -0.172933671 7.410161547 -5.34441926
#> 187 2.014768199 -0.212261210 5.408736284 -5.20583793
#> 188 0.254499203 -0.339685168 -0.741301274 0.94413357
#> 189 2.901667271 0.132888380 1.936037193 -2.31678593
#> 190 2.441192384 -0.038742015 3.872438826 0.10183690
#> 191 2.356939493 -0.301805432 3.873007794 0.14592010
#> 192 3.959190341 0.157465925 -0.793686914 -1.06334174
#> 193 0.750471606 -0.322345642 3.957497943 1.42698198
#> 194 1.216739452 0.500007925 2.310424751 -7.00748130
#> 195 2.686759990 -0.102461482 1.086310635 0.43286435
#> 196 3.138827698 -0.302924637 -5.416163821 0.80680718
#> 197 0.186462784 -0.073853963 0.249274258 -1.81777096
#> 198 2.425045922 0.146128170 -4.350780321 -0.54094254
#> 199 1.615785619 -0.814153778 0.373349892 -1.19361850
#> 200 0.359656950 -0.337991647 1.772512292 0.82220805
#> 201 -0.369605685 -0.277956542 1.184686716 -1.74371727
#> 202 1.436066896 -0.612522035 5.170491540 1.21570241