> getwd() [1] "/home/frioult/svn/kdariane/members/lbo/test/result" > dir() [1] "cluster.cobweb.seed-0.ods" "cluster.csv" [3] "cluster.xsl" "cluster.xsl~" [5] "result.aws" "result.cluster.xml" > ?read.table > X=read.table('cluster.csv') > dim(X) [1] 1200 1 > X=read.table('cluster.csv',sep=",") > dim(X) [1] 1200 6 > head(X) V1 V2 V3 V4 V5 V6 1 1 1 0.01 0 4.50000 0.1284610 2 1 1 0.01 5 8.16667 0.1234770 3 1 1 0.01 10 12.00000 0.1074200 4 1 1 0.01 15 15.16670 0.0730897 5 1 1 0.01 20 19.83330 0.0963455 6 1 2 0.01 0 6.50000 0.3073090 > m=lm(V6~.,data=X) > summary(m) Call: lm(formula = V6 ~ ., data = X) Residuals: Min 1Q Median 3Q Max -0.33522 -0.04065 -0.01039 0.02944 0.31310 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.0700481 0.0079895 8.768 < 2e-16 *** V1 -0.0100799 0.0012157 -8.292 2.98e-16 *** V2 -0.0077818 0.0038823 -2.004 0.0452 * V3 0.1391563 0.0277029 5.023 5.86e-07 *** V4 -0.0131120 0.0003871 -33.874 < 2e-16 *** V5 0.0122540 0.0003387 36.177 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06567 on 1194 degrees of freedom Multiple R-squared: 0.5802, Adjusted R-squared: 0.5784 F-statistic: 330 on 5 and 1194 DF, p-value: < 2.2e-16 > sd(X$V6) [1] 0.1011324 > sqrt(.58) [1] 0.7615773 > plot(V6~V1,ata=X) Erreur dans eval(expr, envir, enclos) : objet 'V6' introuvable > plot(V6~V1,data=X) > plot(V6~V2,data=X) > plot(V6~V3,data=X) > plot(V6~V4,data=X) > > plot(V6~V5,data=X) > his(X$V6,braks=50) Erreur : impossible de trouver la fonction "his" > hist(X$V6,braks=50) Messages d'avis : 1: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) : "braks" n'est pas un paramètre graphique 2: In axis(1, ...) : "braks" n'est pas un paramètre graphique 3: In axis(2, ...) : "braks" n'est pas un paramètre graphique > > m=lm(V6~.+I(V3^2),data=X) > summary(m) Call: lm(formula = V6 ~ . + I(V3^2), data = X) Residuals: Min 1Q Median 3Q Max -0.332387 -0.041648 -0.009792 0.028201 0.310193 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.0604236 0.0085044 7.105 2.06e-12 *** V1 -0.0099602 0.0012115 -8.221 5.21e-16 *** V2 -0.0075799 0.0038677 -1.960 0.05025 . V3 0.5008228 0.1159767 4.318 1.70e-05 *** V4 -0.0130445 0.0003862 -33.781 < 2e-16 *** V5 0.0121722 0.0003384 35.973 < 2e-16 *** I(V3^2) -1.7030392 0.5304341 -3.211 0.00136 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06541 on 1193 degrees of freedom Multiple R-squared: 0.5838, Adjusted R-squared: 0.5817 F-statistic: 278.9 on 6 and 1193 DF, p-value: < 2.2e-16 > > m=lm(V6~.+I(V3^2)+I(V1^2)+I(V2^2)+I(V4^2)+I(V5^2),data=X) > summary(m) Call: lm(formula = V6 ~ . + I(V3^2) + I(V1^2) + I(V2^2) + I(V4^2) + I(V5^2), data = X) Residuals: Min 1Q Median 3Q Max -0.322034 -0.036937 -0.005608 0.027235 0.281894 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 5.225e-02 1.144e-02 4.568 5.43e-06 *** V1 -2.145e-02 5.327e-03 -4.027 6.01e-05 *** V2 -6.353e-03 3.749e-03 -1.695 0.09042 . V3 4.827e-01 1.123e-01 4.298 1.87e-05 *** V4 -1.901e-02 1.049e-03 -18.112 < 2e-16 *** V5 1.912e-02 8.713e-04 21.942 < 2e-16 *** I(V3^2) -1.557e+00 5.139e-01 -3.029 0.00251 ** I(V1^2) 1.638e-03 7.365e-04 2.224 0.02633 * I(V2^2) NA NA NA NA I(V4^2) 2.404e-04 4.647e-05 5.172 2.72e-07 *** I(V5^2) -1.967e-04 2.301e-05 -8.549 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06334 on 1190 degrees of freedom Multiple R-squared: 0.6107, Adjusted R-squared: 0.6078 F-statistic: 207.4 on 9 and 1190 DF, p-value: < 2.2e-16 > table(X$V2) 1 2 600 600 > library(MASS) > stepAIC(m) Start: AIC=-6612.26 V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V2^2) + I(V4^2) + I(V5^2) Step: AIC=-6612.26 V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V4^2) + I(V5^2) Df Sum of Sq RSS AIC 4.7740 -6612.3 - V2 1 0.01152 4.7856 -6611.4 - I(V1^2) 1 0.01984 4.7939 -6609.3 - I(V3^2) 1 0.03680 4.8108 -6605.0 - V1 1 0.06505 4.8391 -6598.0 - V3 1 0.07410 4.8481 -6595.8 - I(V4^2) 1 0.10730 4.8813 -6587.6 - I(V5^2) 1 0.29317 5.0672 -6542.7 - V4 1 1.31607 6.0901 -6322.1 - V5 1 1.93143 6.7055 -6206.6 Call: lm(formula = V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V4^2) + I(V5^2), data = X) Coefficients: (Intercept) V1 V2 V3 V4 V5 0.0522509 -0.0214520 -0.0063531 0.4827467 -0.0190059 0.0191185 I(V3^2) I(V1^2) I(V4^2) I(V5^2) -1.5565453 0.0016379 0.0002404 -0.0001967 > m1=stepAIC(m) Start: AIC=-6612.26 V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V2^2) + I(V4^2) + I(V5^2) Step: AIC=-6612.26 V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V4^2) + I(V5^2) Df Sum of Sq RSS AIC 4.7740 -6612.3 - V2 1 0.01152 4.7856 -6611.4 - I(V1^2) 1 0.01984 4.7939 -6609.3 - I(V3^2) 1 0.03680 4.8108 -6605.0 - V1 1 0.06505 4.8391 -6598.0 - V3 1 0.07410 4.8481 -6595.8 - I(V4^2) 1 0.10730 4.8813 -6587.6 - I(V5^2) 1 0.29317 5.0672 -6542.7 - V4 1 1.31607 6.0901 -6322.1 - V5 1 1.93143 6.7055 -6206.6 > summary(m1) Call: lm(formula = V6 ~ V1 + V2 + V3 + V4 + V5 + I(V3^2) + I(V1^2) + I(V4^2) + I(V5^2), data = X) Residuals: Min 1Q Median 3Q Max -0.322034 -0.036937 -0.005608 0.027235 0.281894 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.225e-02 1.144e-02 4.568 5.43e-06 *** V1 -2.145e-02 5.327e-03 -4.027 6.01e-05 *** V2 -6.353e-03 3.749e-03 -1.695 0.09042 . V3 4.827e-01 1.123e-01 4.298 1.87e-05 *** V4 -1.901e-02 1.049e-03 -18.112 < 2e-16 *** V5 1.912e-02 8.713e-04 21.942 < 2e-16 *** I(V3^2) -1.557e+00 5.139e-01 -3.029 0.00251 ** I(V1^2) 1.638e-03 7.365e-04 2.224 0.02633 * I(V4^2) 2.404e-04 4.647e-05 5.172 2.72e-07 *** I(V5^2) -1.967e-04 2.301e-05 -8.549 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06334 on 1190 degrees of freedom Multiple R-squared: 0.6107, Adjusted R-squared: 0.6078 F-statistic: 207.4 on 9 and 1190 DF, p-value: < 2.2e-16 > y.pred=predict(m) > plot(X$V6,y.pred) > m=lm(V6~.^2+I(V3^2)+I(V1^2)+I(V2^2)+I(V4^2)+I(V5^2),data=X) > summary(m) Call: lm(formula = V6 ~ .^2 + I(V3^2) + I(V1^2) + I(V2^2) + I(V4^2) + I(V5^2), data = X) Residuals: Min 1Q Median 3Q Max -0.32209 -0.03721 -0.00363 0.03028 0.25732 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 4.091e-02 1.976e-02 2.070 0.038627 * V1 -2.430e-02 6.982e-03 -3.480 0.000519 *** V2 8.749e-03 1.063e-02 0.823 0.410692 V3 3.883e-01 1.534e-01 2.531 0.011494 * V4 -2.039e-02 2.059e-03 -9.902 < 2e-16 *** V5 2.135e-02 1.836e-03 11.628 < 2e-16 *** I(V3^2) -1.658e+00 5.112e-01 -3.243 0.001216 ** I(V1^2) 2.384e-03 8.149e-04 2.925 0.003508 ** I(V2^2) NA NA NA NA I(V4^2) 7.427e-05 6.457e-05 1.150 0.250294 I(V5^2) -3.414e-04 5.217e-05 -6.543 8.94e-11 *** V1:V2 -3.486e-03 2.360e-03 -1.477 0.139886 V1:V3 2.031e-02 1.667e-02 1.219 0.223245 V1:V4 5.124e-04 2.778e-04 1.844 0.065387 . V1:V5 -3.080e-04 2.712e-04 -1.136 0.256335 V2:V3 6.087e-02 5.399e-02 1.127 0.259797 V2:V4 -8.140e-04 8.095e-04 -1.006 0.314796 V2:V5 1.327e-04 7.447e-04 0.178 0.858641 V3:V4 -2.456e-02 5.171e-03 -4.751 2.28e-06 *** V3:V5 1.353e-02 4.368e-03 3.097 0.002004 ** V4:V5 3.214e-04 9.208e-05 3.491 0.000499 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.06204 on 1180 degrees of freedom Multiple R-squared: 0.6296, Adjusted R-squared: 0.6236 F-statistic: 105.6 on 19 and 1180 DF, p-value: < 2.2e-16 > history() > q() Save workspace image? [y/n/c]: n maxiquick:[result]$ la total 1188 drwxr-xr-x 2 frioult frioult 4096 2011-04-07 16:02 . drwxr-xr-x 7 frioult frioult 16384 2011-04-07 15:14 .. -rw-r--r-- 1 frioult frioult 133532 2011-04-07 00:28 cluster.cobweb.seed-0.ods -rw-r--r-- 1 frioult frioult 34164 2011-04-06 23:28 cluster.csv -rw-r--r-- 1 frioult frioult 817 2011-04-06 21:22 cluster.xsl -rw-r--r-- 1 frioult frioult 162 2011-04-06 20:30 cluster.xsl~ -rw-r--r-- 1 frioult frioult 91 2011-04-07 16:02 .~lock.cluster.csv# -rw-r--r-- 1 frioult frioult 8032 2011-04-07 00:28 result.aws -rw-r--r-- 1 frioult frioult 999789 2011-04-06 20:29 result.cluster.xml maxiquick:[result]$ less /home/frioult/.r .recently-used.xbel .recently-used.xbel.SH4XRV .recently-used.xbel.3LGFPV .recently-used.xbel.X97EPV .recently-used.xbel.6BVERV .rubberband.wisdom.d .recently-used.xbel.MV1KMV maxiquick:[result]$ R R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R est un logiciel libre livré sans AUCUNE GARANTIE. Vous pouvez le redistribuer sous certaines conditions. Tapez 'license()' ou 'licence()' pour plus de détails. R est un projet collaboratif avec de nombreux contributeurs. Tapez 'contributors()' pour plus d'information et 'citation()' pour la façon de le citer dans les publications. Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide en ligne ou 'help.start()' pour obtenir l'aide au format HTML. Tapez 'q()' pour quitter R. > history() >