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
-15%
Le deal à ne pas rater :
(Adhérents) LEGO® Icons 10318 Le Concorde
169.99 € 199.99 €
Voir le deal
-20%
Le deal à ne pas rater :
-20% sur le Lot de 2 écrans PC GIGABYTE 27″ LED M27Q
429 € 539 €
Voir le deal

 

 TP8 : ANALYSE EN COMPOSANTES PRINCIPALES

Aller en bas 
AuteurMessage
Admin
Admin



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

TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitimeVen 2 Déc à 11:41

Visualiser le nuage de points

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP8';
/* nuage de points*/
title1 'nuage de points';
DATA repdata.tabUS;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP8\ustemp.txt' FIRSTOBS=2 DLM=';';
    INPUT City $ :15. January July;
RUN;
PROC PRINT;
RUN;
/*macro pour affichage*/
title2 'Plot of Raw Data';
   %plotit(data=repdata.tabUS, labelvar=City,
         plotvars=July January, color=black, colors=blue);
   RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



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

TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: Re: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitimeVen 2 Déc à 11:53

Analyse en composantes principales

http://www.ulg.ac.be/pedaexpe/cours/glosaire/acp.htm
http://www.obs-vlfr.fr/Enseignement/enseignants/labat/anado/acp/exemp1.html
http://www.labri.fr/perso/amblard/enseignement/statr/acpcor.pdf

Visualiser le nuage de points projetés avec la macro.

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP8';
/* nuage de points*/
title1 'nuage de points';
DATA repdata.tabUS;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP8\ustemp.txt' FIRSTOBS=2 DLM=';';
    INPUT City $ :15. January July;
RUN;
PROC PRINT;
RUN;

/*macro pour affichage*/
title2 'Plot of Raw Data';
   %plotit(data=repdata.tabUS, labelvar=City,
         plotvars=July January, color=black, colors=blue);
RUN;

/*analyse en composantes principales*/
PROC princomp data=repdata.tabUS cov out=Prin;
   title2;
   var July January;
RUN;

/*affichage*/
title2 'Plot of Raw Data';
   %plotit(data=Prin, labelvar=City,
         plotvars=Prin2 Prin1, color=black, colors=blue);
RUN;


Dernière édition par le Ven 6 Jan à 1:15, édité 7 fois
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



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

TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: Re: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitimeVen 2 Déc à 12:26

Ecrire une ACP sur X1-X5(chenilles)
et faire une régression de Y sur Prin1 Prin2 Prin3


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

/*macro pour affichage*/
title2 'Plot of Raw Data pins';
  %plotit(data=repdata.tabpin, labelvar=y,
        plotvars=x1 x2 x3 x4 x5, color=black, colors=blue);
  RUN;

/*analyse en composantes principales*/
PROC princomp data=repdata.tabpin cov out=Prin;
  title2;
  var x1-x5;
RUN;



DATA pins;
   set repdata.tabpin;
   Prin1=0.999275*X1+ 0.004229*X2+0.036561*X3+ 0.002390*X4+ 0.009475*X5;
   Prin2= -.033904*X1+0.539487*X2+0.833183*X3+0.038344*X4+0.110185*X5;
   Prin3=0.016634*X1+ 0.841889*X2-.535938*X3 -.024521*X4 -.055810*X5;
RUN;

/*Regression rsquare*/
Title1 'Regression rsquare';
PROC REG data=pins;
  model Y=Prin1 Prin2 Prin3;
RUN;


Dernière édition par le Ven 6 Jan à 0:54, é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

TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: Re: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitimeVen 2 Déc à 12:35

Utiliser PROC FACTOR

Code:
Options formdlim='*';
LIBNAME repdata 'C:\Documents and Settings\etudiant\Bureau\TP8';
/* nuage de points*/
title1 'nuage de points';
DATA repdata.tabUS;
    INFILE 'C:\Documents and Settings\etudiant\Bureau\TP8\ustemp.txt' FIRSTOBS=2 DLM=';';
    INPUT City $ :15. January July;
RUN;
PROC PRINT;
RUN;

/*macro pour affichage*/
title2 'Plot of Raw Data';
  %plotit(data=repdata.tabUS, labelvar=City,
        plotvars=July January, color=black, colors=blue);
  RUN;

/*analyse en composantes principales*/
PROC princomp data=repdata.tabUS cov out=Prin;
  title2;
  var July January;
RUN;

/*affichage*/
PROC FACTOR data=repdata.tabUS;
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Admin
Admin



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

TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: Re: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitimeVen 6 Jan à 1:06

ACP sur les données "Europe", sur 2 axes principaux

Code:
Options formdlim='*';
LIBNAME repdata 'G:\DocsdeMicka\Master2\Projets\SAS';
/* nuage de points*/
title1 'nuage de points';
DATA repdata.europe;
    INFILE 'G:\DocsdeMicka\Master2\Projets\SAS\europe.txt';
    INPUT pays $ :17. pop superficie pib date monnaie $;
RUN;
PROC PRINT;
RUN;

/*macro pour affichage*/
title2 'Plot of Raw Data';
  %plotit(data=repdata.europe, labelvar=pays,
        plotvars=pop superficie pib date, color=black, colors=blue);
RUN;

/*analyse en composantes principales*/
PROC princomp data=repdata.europe cov out=Prin;
  title2;
  var pop superficie pib date;
RUN;

/*affichage*/
title2 'Plot of Raw Data';
  %plotit(data=Prin, labelvar=pays,
        plotvars=Prin2 Prin1, color=black, colors=blue);
RUN;
Revenir en haut Aller en bas
https://mastertwo.jeun.fr
Contenu sponsorisé





TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Empty
MessageSujet: Re: TP8 : ANALYSE EN COMPOSANTES PRINCIPALES   TP8 : ANALYSE EN COMPOSANTES PRINCIPALES Icon_minitime

Revenir en haut Aller en bas
 
TP8 : ANALYSE EN COMPOSANTES PRINCIPALES
Revenir en haut 
Page 1 sur 1

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