QUANT METH BEHAV DATA I
QUANT METH BEHAV DATA I PSYC 709
Popular in Course
Popular in Psychlogy
This 2 page Class Notes was uploaded by Alfonso Grady PhD on Monday October 26, 2015. The Class Notes belongs to PSYC 709 at University of South Carolina - Columbia taught by Staff in Fall. Since its upload, it has received 8 views. For similar materials see /class/229641/psyc-709-university-of-south-carolina-columbia in Psychlogy at University of South Carolina - Columbia.
Reviews for QUANT METH BEHAV DATA I
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/26/15
Linear Regression Continued 1 More with PROC GLM PROC GLM which we discussed in the last lab is a procedure that can be used to t simple linear regression and many other type of models For our purposes today we are going to use PROC GLM to do some inference ie con dence intervals Recall that the general statement for the models is PRUC GLM lt options gt MODEL dependentsindependents lt options gt BY variables TEST lt Heffects gt Eeffect lt options gt OUTPUT lt UUTSAS data set gt keywoLd ucuues lt keywoLd ucuues gt lt option gt Recall that the MODEL statement will consist of the variables being considered for a relationship7 with the dependent being the y and the independent variable being X The main output 7keyword7s7 well be using are OUT7 PREDICTED or ll7 and RESIDUAL or R Today well go over the options CLPARM7 and ALPHA that go on the MODEL line after the backslash Here is an example using the hanes data set data new set tmp1hanes secsex run proc sort datanew by sex run proc glm datanew by sex model sysbpdiabpclparm alpha1 output outregdata rresid pyhat run quit proc gplot dataregdata plot yhatresid run quit 2 Using the Data Step with the IF statement The data step in SAS is powerful Some companies one7s i7ve worked for use the data step almost exclusively and the statistical options little What the data step allows you to do is take a gigantic data set and manipulate it with ease It also has allows the power of working with no data at all An example is turning a random variable that has 3 outcomes into one that has two Take the hanes data set for example7 there is a variable smoke that can be one of three levels Not smoked more that 100 cigarettes 17 smoked more than 100 but does not smoke now27 or smoked more than 100 and is still smoking now Say we are interested in 1 vs 2 or 3 Here is the code to do that data new set tmpl nhanes if smode eq 1 then smoke21 if smode eq 2 or smode eq 3 then smoke22 run proc print run Another example is generating States by random data new input SC NC ALB FL GA DTH cards SouthCar NorthCar Alabama Florida Georgia Other data test set new do i1 to 50000 stranuni0 if st 1e 2 then stateDTH if st gt 2 and st 1e 4 then stateSC if st gt 4 and st 1e 6 then stateNC if st gt 6 and st 1e 8 then stateALB if st gt 8 and st 1e 9 then stateFL if st gt 9 and st 1e 10 then stateGA output end drop SC NC ALB FL GA UTH run proc freq tables state run
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'