Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior...

15
Final Thoughts HRP 223 – 2013 December 4 th , 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation is protected by copyright law and international treaties. Unauthorized reproduction of this presentation, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted

Transcript of Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior...

Page 1: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Final Thoughts

HRP 223 – 2013December 4th, 2013

Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved.Warning: This presentation is protected by copyright law and international treaties. Unauthorized reproduction of this presentation, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted to maximum extent possible under the law.

Page 2: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

One more graphic tweak

• You can use styleattrs to set the colors in sgplot. Recall that many procedures automatically generate graphics. You can set the default colors for all your output including those graphics.

Page 3: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Tweaking the Style Template

proc template;define style myStyle;

parent = styles.Statistical;style GraphDataDefault / color=coral;

end;run;

ods html style = myStyle;proc sgplot data = fram;

histogram weight ;run;ods html close;

Set the default color for most ungrouped

data.

Page 4: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

proc template;define style myStyle;parent = styles.Statistical;

style graphdata1 from graphdata1 / contrastColor=pink color = pink;

style graphdata2 from graphdata1 / contrastColor=blue color = blue;

end;run;

ods html style = myStyle;proc sgplot data = fram;

vbar weight / group = sex;xaxis fitpolicy = thin ;

run;ods html close;

Set the default color the first two groups.

Page 5: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

With Header File

• My header file defines a custom style template. You an add those options and set the default colors for the entire set of output:

Set the default color the first two groups.

Page 6: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

When you get data…

• Check for Viruses• Lock the files– Right click> properties>click on read only

• Assume the data has not been cleaned– Logic check every variable (even the ones you are

not going to use).– Do descriptive statistics (numeric and/or graphic)

on every variable.

Page 7: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Cleaning up data

• Do nothing by hand. If you need to change a value do it in a SAS program or in an EG project.

• Keep the source files locked and make changes to the revised versions.

Page 8: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Use SQL

• Look at the SQL that is generated by the EG GUI. Eventually you will be sick of clicking.

Page 9: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Moving from EG to SAS

• Remember that you can right click on nodes in EG and get the code. That code can be run inside of SAS. – This lets you use the statistical graphics editor.– Be sure to add comments to your code.

Page 10: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Use My SAS Header File

• You can get nice looking web pages with very little effort if you use my header file.

Page 11: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Keep it minimal

• Use formats liberally instead of making new variables to recode.

Page 12: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Advanced Stuff

• If you find you need to copy and paste the same code over and over give me a call.– Don’t forget that SAS/Macro functionality is

available as prompts in EG. – Remember that arrays and loops can be used to

do the same task on a lot of different variables.

Page 13: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

When you conduct analyses

• For every p-value you needs a picture.

Page 14: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

Lifetime Warrantee

• HRP 223 comes with a lifetime warrantee. If you and I are alive, you are welcome to come by and ask for help. If either you or I are not alive please do not come for help.

Page 15: Final Thoughts HRP 223 – 2013 December 4 th, 2013 Copyright © 1999-2013 Leland Stanford Junior University. All rights reserved. Warning: This presentation.

This class would not have happened without …

Assemblage 23The Birthday Massacre

HocicoSkinny PuppyVNV Nation

Yaz

ampedout.net

Mike Hurley

Lori Balise