mon master2 ISIFAR
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
mon master2 ISIFAR

ISIFAR
 
AccueilRechercherDernières imagesS'enregistrerConnexion
Le deal à ne pas rater :
Xiaomi Mi Smart Camera 2K Standard Edition (design compact / support ...
11.39 €
Voir le deal
-15%
Le deal à ne pas rater :
(Adhérents) LEGO® Icons 10318 Le Concorde
169.99 € 199.99 €
Voir le deal

 

 TP7 ANALYSE DE DONNEES

Aller en bas 
AuteurMessage
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 11:10

MODELE LINEAIRE SIMPLE


Code:
Options formdlim='*';
/*donnees d'entree pour la regression*/
DATA tabxy;
        INPUT vx vy;
        CARDS;
35 114
45 124
55 143
65 158
75 166
;
RUN;
PROC PRINT;
RUN;

/*visualisation*/
PROC gplot data=tabxy;
 Plot vy*vx;
RUN;

/*régression linéaire simple*/
PROC REG data=tabxy;
 MODEL vy=vx;
RUN;

/*régression linéaire simple avec affichage*/
PROC REG data=tabxy;
 MODEL vy=vx;
 plot vy*vx='*';
RUN;


Dernière édition par le Ven 18 Nov à 17:47, édité 2 fois
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 11:10

MODELE LINEAIRE SIMPLE (2)

sur la page de Mathilde Mougeot, prendre le fichier ficreg2.txt

Code:
/* donnees d'entrée pour la régression*/
DATA fic2;
   INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7\ficreg2.txt' FIRSTOBS=2 DLM=';';
   INPUT vx vy;
RUN;

/*régression linéaire simple*/
title1 'regression vy en fonction de vx';
PROC REG data=fic2;
  MODEL vy=vx;
  PLOT vy*vx;
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 11:54

Code:
/* Création de la variable lnvy*/
DATA fic2;
   set fic2;
    lnvy=LOG(vy);
RUN;

/*régression simple avec affichage*/
title1 'regression lnvy en fonction de vx';
PROC REG data=fic2;
  MODEL lnvy=vx;
  PLOT lnvy*vx='*';
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 11:54

MODELE LINEAIRE MULTIPLE

sur la page de Mathilde Mougeot, prendre le fichier pins.txt

Code:
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression avec toutes les variables*/
title1 'Regression avec toutes les variables';
PROC REG data=repdata.tabpin;
    MODEL Y=x1-x10;
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 20:31

????????
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 20:32

Régression ascendante : intégration successive des variables les plus significatives

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression ascendante*/
Title1 'Regression ascendante';
PROC REG data=repdata.tabpin;
    model Y=X1-X10/ selection=forward;
RUN;

Forward Selection (FORWARD)
The forward-selection technique begins with no variables in the model. For each of the independent variables, the FORWARD method calculates F statistics that reflect the variable's contribution to the model if it is included. The p-values for these F statistics are compared to the SLENTRY= value that is specified in the MODEL statement (or to 0.50 if the SLENTRY= option is omitted). If no F statistic has a significance level greater than the SLENTRY= value, the FORWARD selection stops. Otherwise, the FORWARD method adds the variable that has the largest F statistic to the model. The FORWARD method then calculates F statistics again for the variables still remaining outside the model, and the evaluation process is repeated. Thus, variables are added one by one to the model until no remaining variable produces a significant F statistic. Once a variable is in the model, it stays.


Dernière édition par le Ven 18 Nov à 20:51, édité 1 fois
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 20:38

Régression descendante : élimination progressive des variables les moins significatives

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression descendante*/
Title1 'Regression descendante';
PROC REG data=repdata.tabpin;
   model Y=X1-X10/ selection=backward;
RUN;

Backward Elimination (BACKWARD)
The backward elimination technique begins by calculating F statistics for a model, including all of the independent variables. Then the variables are deleted from the model one by one until all the variables remaining in the model produce F statistics significant at the SLSTAY= level specified in the MODEL statement (or at the 0.10 level if the SLSTAY= option is omitted). At each step, the variable showing the smallest contribution to the model is deleted.
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 20:54

Régression stepwise : concerne un nombre optimale de variables

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression stepwise*/
Title1 'Regression stepwise';
PROC REG data=repdata.tabpin;
  model Y=X1-X10/ selection=stepwise;
RUN;

Stepwise (STEPWISE)
The stepwise method is a modification of the forward-selection technique and differs in that variables already in the model do not necessarily stay there. As in the forward-selection method, variables are added one by one to the model, and the F statistic for a variable to be added must be significant at the SLENTRY= level. After a variable is added, however, the stepwise method looks at all the variables already included in the model and deletes any variable that does not produce an F statistic significant at the SLSTAY= level. Only after this check is made and the necessary deletions accomplished can another variable be added to the model. The stepwise process ends when none of the variables outside the model has an F statistic significant at the SLENTRY= level and every variable in the model is significant at the SLSTAY= level, or when the variable to be added to the model is the one just deleted from it.
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 20:58

Régression "rsquare"

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression rsquare*/
Title1 'Regression rsquare';
PROC REG data=repdata.tabpin;
  model Y=X1-X10/ selection=rsquare best=1;
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 21:08

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression rsquare*/
Title1 'Regression rsquare n°2';
PROC REG data=repdata.tabpin;
  model Y=X1-X10/ selection=rsquare;
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 18 Nov à 21:08

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression rsquare*/
Title1 'Regression rsquare n°3';
PROC REG data=repdata.tabpin;
  model Y=X1-X10/ selection=rsquare best=1 cp aic bic;
RUN;


R^2 Selection (RSQUARE)
The RSQUARE method finds subsets of independent variables that best predict a dependent variable by linear regression in the given sample. You can specify the largest and smallest number of independent variables to appear in a subset and the number of subsets of each size to be selected. The RSQUARE method can efficiently perform all possible subset regressions and display the models in decreasing order of R2 magnitude within each subset size. Other statistics are available for comparing subsets of different sizes. These statistics, as well as estimated regression coefficients, can be displayed or output to a SAS data set.

The subset models selected by the RSQUARE method are optimal in terms of R2 for the given sample, but they are not necessarily optimal for the population from which the sample is drawn or for any other sample for which you may want to make predictions. If a subset model is selected on the basis of a large R2 value or any other criterion commonly used for model selection, then all regression statistics computed for that model under the assumption that the model is given a priori, including all statistics computed by PROC REG, are biased.

While the RSQUARE method is a useful tool for exploratory model building, no statistical method can be relied on to identify the "true" model. Effective model building requires substantive theory to suggest relevant predictors and plausible functional forms for the model.

The RSQUARE method differs from the other selection methods in that RSQUARE always identifies the model with the largest R2 for each number of variables considered. The other selection methods are not guaranteed to find the model with the largest R2. The RSQUARE method requires much more computer time than the other selection methods, so a different selection method such as the STEPWISE method is a good choice when there are many independent variables to consider.

Dans l'aide chercher :
MODEL statement, REG procedure
CP Mallows' Cp statistic
AIC Akaike Information Criterion
BIC Sawa's Bayesians IInformation CCriterion


Dernière édition par le Mar 22 Nov à 20:06, édité 5 fois
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeLun 28 Nov à 2:21

Option d'affichage dans la procédure de régression

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression rsquare*/
Title1 'affichage regression rsquare';
PROC REG data=repdata.tabpin;
  model Y=X1 X2 X4 X5;
  plot residual.*predicted.;    /* ou plus simplement r.*p. */
RUN;


Predicted and Residual Values

The display of the predicted values and residuals is controlled by the P, R, CLM, and CLI options in the MODEL statement. The P option causes PROC REG to display the observation number, the ID value (if an ID statement is used), the actual value, the predicted value, and the residual. The R, CLI, and CLM options also produce the items under the P option. Thus, P is unnecessary if you use one of the other options.

The R option requests more detail, especially about the residuals. The standard errors of the mean predicted value and the residual are displayed. The studentized residual, which is the residual divided by its standard error, is both displayed and plotted. A measure of influence, Cook's D, is displayed. Cook's D measures the change to the estimates that results from deleting each observation (Cook 1977, 1979). This statistic is very similar to DFFITS.

The CLM option requests that PROC REG display the 100(1-alpha)% lower and upper confidence limits for the mean predicted values. This accounts for the variation due to estimating the parameters only. If you want a 100(1-alpha)% confidence interval for observed values, then you can use the CLI option, which adds in the variability of the error term. The alpha level can be specified with the ALPHA= option in the PROC REG or MODEL statement.

You can use these statistics in PLOT and PAINT statements. This is useful in performing a variety of regression diagnostics.
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



Nombre de messages : 418
Date d'inscription : 27/09/2005

TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitimeVen 2 Déc à 11:40

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS';
/* donnees d'entrée pour la régression*/
DATA repdata.tabpin;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP7_SAS\pins.txt' FIRSTOBS=2 DLM=';';
    INPUT y x1-x10;
RUN;

/*Regression rsquare*/
Title1 'affichage regression de Y en fonction de Y';
PROC REG data=repdata.tabpin;
  model Y=X1 X2 X4 X5;
  plot p.*Y;   
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Contenu sponsorisé





TP7 ANALYSE DE DONNEES Empty
MessageSujet: Re: TP7 ANALYSE DE DONNEES   TP7 ANALYSE DE DONNEES Icon_minitime

Revenir en haut Aller en bas
 
TP7 ANALYSE DE DONNEES
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
mon master2 ISIFAR :: 1er semestre :: SAS-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser