Cette page appartient aux archives web de l'EPFL et n'est plus tenue à jour.
This page belongs to EPFL's web archive and is no longer updated.

SMAT - Linear Models Course

Exercice 1, série 11

Bonjour,

il me semble que lorsque j'utilise la fonction bisquare, ma regression robuste fonctionne. Cependant quand je veux plotter cette regression, je reçois le message d'erreur suivant:

rfit2 <- rlm(calls~year, phones, method="M", psi=psi.bisquare)

plot(rfit2)

 

Erreur dans lm.influence(x, do.coef = FALSE) : 
  non-NA residual length does not match cases used in fitting
 
je ne comprends pas...
 
 
Posted by Mahé Fellay at 11:05
Comments (2)
Practical 2 : the data

Hi,

In the presentation of the data is it necesseray to include boxplot and scatter plots of all the observations, or should we just include plots for the weight and Horsepower ?

Thanks iin advance

Clément

Posted by Clément Genetet at 13:33
Comments (1)
Practical 2 : Still some influential observations after cleaning

Hello,

In part e), after fitting the model we chose, we noticed 4 observations outliers + leverage points, so we decided to remove them. But after refitting the model without thoses observations a new outlier + leverage point observation appears. 

Is that normal ? If so, should we refit the model again without that observations ?

Thanks in advance,
Jérémy

Posted by Jeremy Gotteland at 11:07
Comments (1)
Practical 1 - R misunderstanding

Hello,

We do not understand why

y <- 100/cars[,7]

x1 <- cars[,25]

x2 <- cars[,13] / x1

 

lm(y ~ x1 + x2) 

 

Produces a different model fit than 

lm(100/CityMPG ~ Weight + (Horsepower/Weight) , data=cars)

 

Can you explain that behaviour ? 

Thanks in advance,
Jérémy

 
Posted by Jeremy Gotteland at 14:08
Comments (3)
Practical 1 - plots

Hello,

When we're asked to analyse data in paragraph 2, the method suggest than we plot boxplots and scatter plots of response vs. each covariate

But basically box plots and scatterplots are the same when plotting response versus weight or horsepower as every car's got a different value for these variables. On the contrary, if we want to analyse response vs type of transmission, box plots are usefull.

Do we have to choose between scatter and box plots ? Do we need to tell the relevance of each variables or only the ones that we think they're relevant ?

Regards

Posted by Pierre Morel at 17:29
Comments (2)
RStudio

You may have noticed that standard R only comes with a command line user's interface (on OS X there is also a simple GUI provided). I recently discovered a very nice and useful GUI for R called RStudio (http://www.rstudio.com/). It makes working with R very simple and pleasant and I would recommend you to give it a try when you are working on the practical exercises!

Posted by Mikael Kuusela at 14:02
Practical 3

Hello à tous,

Je suis entrain de peaufiner le practical 3. Il était écrit que le dernier practical serait plus long que les autres. Pourtant, j'ai en fait la moitié de ce que j'ai fait pour les deux premiers practical (6 petites pages). Est-ce normal ? Est-ce le cas pour tout le monde (qui le fait?) ?

Bonne journée, à pluuus,

J.

Posted by Julien Duvanel at 10:13
Comments (1)
stepAIC vs AIC

Je voulais savoir si quelqu'un connaissait la différence entre
les résultats pour l'AIC donné par les commandes stepAIC et AIC dans R.

Merci d'avance.

Posted by Luis Miguel De Oliveira Vilaca at 18:29
Comments (2)
Exporter tableaux de R - Latex; arrondir les nombres sour R

Pour vos practicals: il y a le package "xtable" qui permet de transformer des outputs R en Latex (il faut l'installer avec install.packages).

Sinon les commandes "signif" et "round" peuvent être utiles aussi pour arrondir des nombres...

Posted by Shahin Tavakoli at 18:34
Comments (1)