24.04.2014 Views

Pratique de Sas Windows ...9.3 Volume 2 - Ined

Pratique de Sas Windows ...9.3 Volume 2 - Ined

Pratique de Sas Windows ...9.3 Volume 2 - Ined

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

La matrice ainsi importée est visible dans le Result Viewer, toutes les variables sont importées contrairement à<br />

l’importation précé<strong>de</strong>nte et conservent un format numérique, cependant le nom <strong>de</strong>s variables n’est pas conservé.<br />

Si l’on souhaite importer toutes les informations y compris le nom <strong>de</strong>s variables et les i<strong>de</strong>ntifiants, le format<br />

caractère semble être le plus adapté.<br />

Une fois dans <strong>Sas</strong> iml, il <strong>de</strong>vient possible <strong>de</strong> passer la matrice <strong>de</strong>s données dans une table <strong>Sas</strong> en insérant les<br />

comman<strong>de</strong>s qui suivent dans proc iml; avant la comman<strong>de</strong> quit;<br />

Voici les <strong>de</strong>ux solutions proposées par la documentation <strong>Sas</strong> pour transformer une matrice en table <strong>Sas</strong>.<br />

*manière 1 ;<br />

Create lib.impmatr from xxx;<br />

append from xxx;<br />

show datasets;<br />

close lib.impmatr;<br />

*manière 2;<br />

create lib.matrixvar<br />

append from xxx;<br />

close lib.matrixvar;<br />

quit;<br />

var{col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11<br />

col12 col13 col14 col15 col16 };<br />

Les <strong>de</strong>ux mo<strong>de</strong>s <strong>de</strong> création <strong>de</strong> tables <strong>Sas</strong> aboutissent, étant donné qu’IML n’accepte que <strong>de</strong>s matrices<br />

entièrement caractère ou entièrement numérique à réceptionner dans <strong>Sas</strong> Foundation, une table entièrement<br />

constituée <strong>de</strong> variables caractères.<br />

A l’intérieur d’une proc iml, l’importation d’un dataframe à partir <strong>de</strong> R sous <strong>Sas</strong> s’effectue, à l’ai<strong>de</strong> <strong>de</strong> la<br />

comman<strong>de</strong><br />

call ImportDataSetFromR ("libref.table", "dataframe" )<br />

proc iml;<br />

submit / R;<br />

x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!