#### mortgage_dep.sas

DePaul, WEEK 423
Excerpt: ... * Add title to output; title "Mortage refusal rate by applicant racial profile"; /* options in infile statement * delimiter = "09"x specifies data are spaced by Tabs; * firstobs = n specifies first obs is in n-th row; */ data mortgage; infile "C:\Documents and Settings\rsettimi\My Documents\Courses\CSC423\Lecture Notes\Week3\mortgage_refusal_rate.txt" delimiter = "09"x firstobs=4; input bank \$ minor white; differ=minor-white; /* One way of computing paired t-test: proc univariate on variable differ, see tests on average results. This is useful to check normality assumptions. */ proc univariate normal plot; var differ; histogram/ normal cfill=white pfill=solid ; probplot/ normal (mu=est sigma=est color=blue l=1 w=1); run; /* Second way of computing paired tests: use ttest procedure & paired statement*/ proc ttest data=mortgage; paired minor*white; run; proc gplot; plot (minor white)*white/overlay; run; ...

#### lesson3

Minnesota, PH 3
Excerpt: ... Lesson 3 Overview Descriptive Procedures Controlling SAS Output Comment and Option Statements Program 3 in course notes Cody & Smith (Chapter 2) Descriptive Procedures In SAS PROC PRINT PROC MEANS PROC UNIVARIATE PROC FREQ PROC (G)PLOT PROC (G)CHART Displays your data Statistics for continuous variables Detailed statistics for continuous variables Frequency counts for categorical variables X-Y Plots Bar charts Syntax for Procedures PROC PROCNAME DATA=datasetname <options> ; substatements/<options> ; The WHERE statement is a useful substatement available to all procedures. PROC PRINT DATA=demo ; VAR marstat ; WHERE state = 'MN'; Program 3 DATA weight; INFILE C:\SAS_Files\tomhs.data' ; INPUT @1 ptid \$10. @12 clinic \$1. @30 sex \$1. @58 height 4.1 @85 weight 5.1; bmi = (weight*703.0768)/(height*height); * BMI is calculated in kg/m2; RUN; PROC PRINT DATA = weight (OBS=5); TITLE 'Proc Print: Five observations from the TOMHS Study'; RUN; PROC MEANS DATA = weight; VAR height weight bmi ...

#### lab7

Michigan State University, SAS 421
Excerpt: ... tion, stores them in the dataset binsamp10, and applies proc univariate to get a summary of the means and a histogram. We make use of proc freq for the first time here. The only other unfamiliar part is the id bin statement after proc surveyselect. This tells SAS that 1 we only want samples from the bin population, not the others. Run the program and then use the output to answer the questions below. NOTE: To save space, I haven't included any title statements in the SAS programs. It would be wise to add title statements to your programs to keep track of the copious output! Also, the programs will take a few (maybe 2030) seconds to run. data various; infile 'u:\msu\course\stt\421\summer04\various.dat'; input exp cau nor bin; proc surveyselect data = various n = 10 rep = 1000 out = binsamp10; id bin; proc univariate data = binsamp10 noprint; output out = binmeans10 mean = Mean; var bin; by replicate; proc univariate data = binmeans10; var mean; histogram mean / midpoints = 0 to 1 by 0.1; proc freq data = bi ...

#### lab6

Michigan State University, SAS 421
Excerpt: ... e well take 800 samples of size n = 5. data pop; input nums; cards; 1 3 3 5 7 9 3 11 13 15 15 27 ; proc surveyselect data = pop n=5 rep=800 out = samp3; proc means data=samp3 noprint; output out=means5 mean = Mean; var nums; by replicate; proc univariate data=means5; histogram mean; run; Explanation 1. We used noprint to tell SAS not to print the 800 sample means! 2. We used output out=means5 sampmean=Mean to tell SAS to create a new dataset named means5 and store in it a variable named sampmean that contains the 800 means computed by proc means. 3. The output of proc univariate and the associated histogram give us an idea about the distribution of the mean in this (toy) problem. (a) What is the mean of the 800 sample means? Is it close to the population mean? (b) What is the standard deviation of the 800 sample means? Is it smaller, larger, or about the same as the population standard deviation? (c) Is the distribution of sample means approximately symmetric? Other statistics So far weve focused on ...

#### practice_exam1

N.C. State, ST 505
Excerpt: ... Additional practice problems for Exam 1: ST 505 (Answers will be given in lecture class.) 1. Consider a study investigating whether or not private-sector jobs tend to have higher salaries than equivalent government-based jobs. Paired data was collected on private-sector and government salaries by matching a job (in private and government areas) as closely as possible based on type of job, educational background, experience, etc. The output from a PROC UNIVARIATE procedure on the variable diff = private salary government salary is given below. Part of the code is provided first. (5 points each part; 7 parts) data salaries; input priv gov; diff = priv - gov; datalines; 12500 11750 22300 20900 14500 14800 . . . ; proc univariate ; var diff; run; The UNIVARIATE Procedu re Var i a b l e : di f f Moments N Mean Std Dev ia t i o n Skewness Uncor r e c t e d SS Coef f Var i a t i o n 12 662.5 1110 .10339 - 0.1208309 18822500 167.562776 Sum Weigh t s Sum Observa t i o n s Var i a nce Kur t o s i s Cor rec t ed SS Std ...

#### mcnemar

Montana, ST 530
Excerpt: ... DM 'LOG;CLEAR;OUT;CLEAR;'; OPTIONS LS=64 PS=60 NONUMBER NODATE; *; * McNemar's Test *; *; * Example 1 - page 53 of notes *; DATA ex1; INPUT patients \$ controls \$ freq @; DO I = 1 TO freq; output; END; CARDS; YES YES 26 YES NO 15 NO YES 7 NO NO 37 DATA ex1; SET ex1; IF patients = 'YES' THEN patients = 1; ELSE patients = 2; IF controls = 'YES' THEN controls = 1; ELSE controls = 2; diff = patients - controls; if diff ne 0; * USE RESULTS FOR THE SIGN TEST *; PROC UNIVARIATE DATA=ex1; VAR diff; TITLE 'McNEMAR'S TEST - EXAMPLE 1'; *; * Example 2 - page 53 of notes *; DATA ex2; INPUT day_1 \$ day_30 \$ freq @; DO I = 1 TO freq; output; END; CARDS; ADULT ADULT 4 ADULT CHILD 14 CHILD ADULT 4 CHILD CHILD 3 DATA ex2; SET ex2; IF day_1 = 'ADULT' THEN day ...

#### sashandout

Purdue, STAT 512
Excerpt: ... 3.178 3.310 3.538 3.083 3.013 3.245 2.963 3.522 3.013 2.947 2.118 . . 21 14 28 22 21 31 32 27 29 26 24 30 24 24 33 27 25 31 25 20 This illustrates the basic format for data. Each row contains data for a dierent individual. In this case, the individuals are 120 students. SAS calls each row an observation. Each column contains the values of one variable for these individuals. There are two variables, with their values for each student separated by blank spaces. The rst variable is the students grade point average at the end of the year, the second is the students ACT score. 3.2 A sample SAS program The SAS program le named prog1.sas contains a SAS program that reads and analyzes the data in ch01pr19.txt. Here is the program: data gpa; inle h:/STAT512/CH01PR19.txt; input y x ; run; proc print data=gpa; proc reg; model y=x; output out=gpa1 p=pred r=resid; run; symbol1 v=circle i=rl; proc gplot data=gpa1; plot y*x; run; proc print data=gpa1; run; proc univariate noprint; var resi ...

#### CLT & LLN

Maryland, BIOM 602
Excerpt: ... dard error? Which effect is the most important and why? (hint: you may use the SAS PROGRAM III as a base, and changes the number of samples and sample size to run several times) 3 options nodate nocenter pageno=1 linesize=75 pagesize=50; /* SAS Program I*/ /*Hint: run the programs section by section*/ data a; do Sub=1 to 900; X = 75+9*rannor(1); output; end; run; proc chart data=a; vbar X; run; proc univariate data=a plots normal; var X; run; data b; do sub=1 to 900; U = 1+(6-1)*ranuni(1); output; end; run; proc chart data=b; vbar U; run; proc univariate data=b plots normal; var U; run; data c; do subj=1 to 900; E = ranexp(1); output; end; run; proc chart data=c; vbar E; run; proc univariate data=c plots normal; var E; run; 4 /* SAS Program II */ DM 'log;clear;out;clear;'; data a1; do S=1 to 100; do n=1 to 9; X1=75+9*rannor(1); output; end; end; run; /* proc print data=a1; run; */ proc chart data=a1; vbar X1/midpoints=50 to 100 by 5; run; proc univariate data=a1 plots normal; var X1; run; proc means d ...

#### threelecture9

Cal Poly, STAT 330
Excerpt: ... defaults are no longer used and they must be specified. Default significance level is 0.05 4 13 PROC MEANS (cont) ex. Using the hotdog data set calculate a 99% confidence interval for the true mean sodium in the three types of hotdog. libname sasdata '\Cosam11\stat\rottesen\Studio-Statistics\stat330\sasdata\'; proc means data=sasdata.hotdogs; * clm alpha=0.01;*n mean stderr clm alpha=0.01; var sodium; by type; *class type; * try with class and not by; run; 14 TRY IT The SAS data set NBA salaries contains data on NBA players and their salaries during the 20002001 season. Instructions: 1. Using the SAS dataset NBAsalary calculate the mean and median salary for all players. 2. Next re-calculate the mean and median for each team. 15 PROC UNIVARIATE Proc univariate is useful for everything descriptivewise univariate has an EXCESS of output way more options than proc means Note: typical options of interest include: plot (S&L, box, and normal) normal (test of normality) 5 16 PROC UN ...

#### hw2

Minnesota, PH 2
Excerpt: ... ay negative values will indicate a decrease from baseline and positive values will indicate an increase from baseline. 3. Use a procedure that displays the counts and means of the 3 weight and 3 systolic BP variables. What was the average weight change? How many missing values are there for wtdif and sbpdif? Use a procedure that displays the means of the 3 weight and 3 systolic BP variables separately for men and women. Which sex had the greatest average decrease in weight? Losing weight should reduce blood pressure. Explore this by analyzing the variables wtdif and sbpdif using proc gplot, proc corr, and proc reg. What is the correlation between wtdif and sbpdif. What is the regression equation? (Note: sbpdif should be the dependent variable). 4. 5. 6. Run proc univariate for the variable wtdif. What are the 25th, 50th, and 75th percentiles of weight change? Which patient ID had the greatest loss in weight? (Hint: Use the ID statement in proc univariate ). 7. Run the proc univariate procedure from item ...

#### meetingnotes2

CSU Mont. Bay, SURVEY 2003
Excerpt: ... SECOND MEETING NOTES 9/4/03 1. Read in Excel file in SAS use: PROC IMPORT PROC FORMAT PROC LABEL (pg. 66 Cody and Smith book) 2. Bargraph use: PROC CHART PROC GCHART Descriptive Statistics use: PROC UNIVARIATE (categories) PROC FREQ (sample size) 3. Analysis a) % of usage of each question b) tables (two variables) examples: Q1 vs Q2, Q9 vs Q22, Q9 vs Q23, Q10 vs Q22, Q10 vs Q23, Q4 vs Q22,Q4 vs Q23, etc. Comments about each table ...

#### daycaresas

Minnesota, PH 6415
Excerpt: ... * This is a short example program to demonstrate what proc univariate ; DATA demo; INPUT weight; DATALINES; 68 63 42 27 30 36 28 32 79 27 22 23 24 25 44 65 43 23 74 51 36 42 28 31 28 25 45 12 57 51 12 32 49 38 42 27 31 50 38 21 16 24 69 47 23 22 43 27 49 28 23 19 46 30 43 49 12 ; RUN; TITLE ' Proc Univariate by Susan Telke'; * Proc Univariate will analyze quantitative variables only; PROC Univariate DATA=DEMO Normal Plot; VAR weight; Histogram weight / midpoints = 10 to 80 by 5 normal; RUN; ...

#### H4b

Iowa State, ANS 500
Excerpt: ... Specification PROC UNIVARIATE ; VAR variable-list; To specify other options: PROC UNIVARIATE PLOT NORMAL; NORMAL option produces a test of normality PLOT option produces three plots of your data stem-and-leaf plot box plot normal probability plot Program to read data from a file called assign2b.txt and then runs PROC UNIVARIATE : DATA statepop; INFILE `~/ans500/assign2b.txt'; INPUT state \$ pop @; LABEL pop = '1980 CENSUS POPULATION IN MILLIONS'; RUN; PROC UNIVARIATE freq plot normal; VAR pop; ID state; RUN; QUIT; ...

#### topic7a.summ

Purdue, STAT 514
Excerpt: ... Statistics 514: Design of Experiments Topic 7a Summary Diagnostics Assumptions should be known understood disbelieved checked Different assumptions lead to different answers Want to verify assumptions or assess how far from assumptions we are One-way design (verifiable) main assumptions: independence constant variance normality Consequences Predictions fine. Inference invalid. Steps Make assumptions. Check assumptions. (visual inspection/leveraged by tests) Fix assumptions. Residuals Estimated residuals are biased. Should be checked with histogram, qqplot against predicted values Plot against other variables to check for patterns Used for tests (Bartlett, Levene, Shapiro-Wilks, etc.) 1 In proc glm, use line means type/hovtest = levene(type = abs) (only with one-way designs) For normal tests, use proc univariate with normal option. proc univariate data = data normal; var variable Deviations from assumptions may be hard to pick apart, but more easily diagnose ...

#### week7_sols

Allan Hancock College, WEEK 2291
Excerpt: ... . The calculated T does not lie in the critical region so the null hypothesis would be accepted. Acknowledging ties in the ranking gives Tz = 28/279 = 1.676. The standard Z for upper one-tail with 5% is 1.64 and the calculated 1.676 lies in the critical meaning that H0 is rejected (the same result as obtained using the less powerful Sign test). Here ignoring the ties in the ranking leads to a misleading conclusion. Question D Air Pollution H0: sulphur oxides 27 H1: sulphur oxides > 27 Pairs are constructed by comparing each observation against 27. The difference is found as the observation minus 27. We expect positive values as it is thought that pollution is occurring. See the solution below for Section C where this question is answered using SAS. SECTION C USING SAS FOR THE SIGN AND WILCOXON TESTS Introduction The Sign and Wilcoxon tests for paired data are carried out in SAS in PROC UNIVARIATE . SAS test statistic for the Sign test SAS uses a variation on the traditional Sign test statistic as given ...

#### b7

Iowa State, CHAPTER 2
Excerpt: ... Example B7 SAS PROGRAM libname mylib 'C:\Documents and Settings\.\stat479\'; proc univariate data=mylib.fueldat plots normal; var pop income; id state; title 'Use of Proc Univariate to Examine Distributions:1'; run; proc univariate data=mylib.fueldat cibasic mu0=4 500 trim=2; var income fuel; id state; title 'Use of Proc Univariate to Compute Statistics:2'; run; proc univariate data=mylib.fueldat noprint; var fuel percent; output out=stats pctlpts=33.3 66.7 pctlpre=fuel lic; title 'Calculation of User Specified Percentile Points'; run; proc print data=stats; run; SAS Log 1 options ls=80 ps=48 nodate pageno=1; 2 libname mylib 'C:\Documents and Settings\mervyn\My Documents\Classwork\stat479\'; NOTE: Libref MYLIB was successfully assigned as follows: Engine: V9 Physical Name: C:\Documents and Settings\mervyn\My Documents\Classwork\stat479 3 4 proc univariate data=mylib.fueldat plots normal; 5 var pop income; 6 id state; 7 title 'Use of Proc Univariate to Examine Distributions:1'; 8 run; NOTE: PROCEDURE UNIVA ...

#### hw4

Wisconsin Milwaukee, EDPSY 724
Excerpt: ... 315-724 / Razia Azen Homework: independent samples t-tests and power Note: For answers involving computer output (i.e., 2a and 2b), please edit your output and hand in only the output relevant to your answer! 1. Howell pp 209-210, exercises 7.26, 7.27, 7.29 (do these by hand). 2. Recall the main research questions (and the associated null hypotheses) in Study 1 of the "Territorial Defense" article. Using SAS (and the example discussed in class): (a) Run the analyses and hand in the output that corresponds to the results reported in the second paragraph of the Results section for Study 1 (p. 824). Highlight the relevant numbers on your output. Specifically, show the following: Descriptive information on the departure time (first line of second paragraph in the Results section). Highlight the range, mean, and standard deviation reported. (Hint: use either proc univariate or proc means). The reported means and test results for sex differences, both in number of passengers and in departure times. The reported m ...

#### Ruback1_old

Wisconsin Milwaukee, EDPSY 724

#### SASPROC1

DePaul, WEEK 423
Excerpt: ... sts: T (t-statistic), PRT (p-value). Notice that SAS provides a test only for a zero population average, i.e. H0: =0. PROC UNIVARIATE The PROC Univariate computes several descriptive statistics, including the mean, the median, the percentiles, the standard deviation, min, max, etc. The list below includes some statements that can be used with the UNIVARIATE procedure. PROC UNIVARIATE DATA=dataset-name; BY <DESCENDING> variable-1 <NOTSORTED>; VAR variables; ID id-variable; HISTOGRAM / normal cfill=WHITE pfill=SOLID name='HIST'; Calculate separate statistics for each BY group Select the analysis variables and determine their order in the report. Variables are one or more measurement variables in the dataset If used, it is the name of one variable used to identify the extreme observations Create a high-resolution graph of a histogram / OPTIONS: normal is an option to fit the normal distribution and draw the normal density on the graph; cfill, pfill control the appearance of the histogram. Create a high-resolut ...

#### An_introduction_to_SAS____Part_3_

Cornell, BTRY 6030
Excerpt: ... exam1 exam2 final grade grade_1; run; proc freq data= grades1; tables gender grade_1 grade/ NOCUM; run; data a; input gender \$ height weight; cards; M 68.5 155 F 61.2 99 F 63.0 115 M 70.0 205 M 68.6 170 F 65.1 125 M 72.4 220 M 188 ; RUN; PROC NOPRINT DATA=A; RUN; PROC MEANS DATA=A N MEAN MIN MAX STD CLM; TITLE "DESCRIPTIVE STATISTICS"; VAR HEIGHT WEIGHT; RUN; PROC UNIVARIATE DATA= A NORMAL PLOT; TITLE " MORE DESCRIPTIVE STATISTICS"; VAR HEIGHT WEIGHT; RUN; /* pRODUCE HISTOGRAM*/ PROC UNIVARIATE DATA= A; VAR HEIGHT WEIGHT; HISTOGRAM HEIGHT WEIGHT/ NORMAL; RUN; PROC UNIVARIATE DATA =A; VAR HEIGHT WEIGHT; HISTOGRAM HEIGHT /MIDPOINTS = 60 TO 75 BY 5 NORMAL; HISTOGRAM WEIGHT / MIDPOINTS = 90 TO 230 BY 20 NORMAL; RUN; /* PRODUCE QQ PLOT*/ PROC UNIVARIATE DATA=A; VAR HEIGHT WEIGHT; QQPLOT HEIGHT WEIGHT; RUN; /*PROBABILITY PLOT*/ PROC UNIVARIATE DATA=A; VAR HEIGHT WEIGHT; PROBPLOT WEIGHT HEIGHT; RUN; /*SORT DATA BY GENDER*/ PROC SORT DATA=A; BY GENDER; RUN; PROC PRINT RUN; /*RUN PROC PROC MEANS BY GENDER; VAR HEIG ...

#### week7

Allan Hancock College, WEEK 2291
Excerpt: ... gh, and see what happens. (c) SECTION C USING SAS FOR THE SIGN AND WILCOXON TESTS Introduction The Sign and Wilcoxon tests for paired data are carried out in SAS in PROC UNIVARIATE . SAS test statistic for the Sign test SAS uses a variation on the traditional Sign test statistic as given to you in lectures. It is taken as the average of the number of pluses and number of minuses, and is referred to as M. The decision to use this form rather than the simpler sum of pluses, is a personal choice. The null distribution (table) needed for the version, M, is not the same as the binomial used for the traditional. You do not need to worry about the table for M simply make use of the probability given by SAS and trust that it is identical with what you would get using the binomial with p = 0.5 and your traditional T (the sum of the positives). Warning: the p value given by SAS is for two tails SAS test statistic for the Wilcoxon test SAS uses a variation on the traditional Wilcoxon test statistic. It subtracts fr ...

#### 8th lab notes 709

Columbia SC, PSYC 709
Excerpt: ... Graphs 1 Creating Histograms with Smoothed Lines Earlier in the year, we learned how to create high resolution histograms using Proc Univariate . Today we are going to add a smoothed line to our histograms. These lines, when properly applied, reveal more clearly the underlying trend to our data. Using the HIST option in the Univariate procedure we can add a smoothed line to our histogram using a Distribution (such as the normal), or using a Kernel. When we use the distributional technique, we will specify a statistical distribution such as the Normal. SAS will then compute and and draw a normal curve overlayed on the histogram with the computed parameters. The Kernel option (also known as nonparametric density estimation) will superimpose a Kernel density estimates on the histogram. Using a Kernel can be a more eective way to view the data then a histogram or using a distribution, since patterns will not be as eected by bin width or sampling variation. The main option used in Kernel is c = (bandwi ...

#### c11

Iowa State, STAT 479
Excerpt: ... Example C11 SAS Program goptions reset=all; goptions hsize=7.5 in vsize= 5.5 in rotate=landscape targetdevice=pscolor; data chicks; input wtgain @; label wtgain ='Weight gain (in gms) after 8-weeks'; datalines; 3.7 4.2 4.4 4.4 4.3 4.2 4.4 4.8 4.9 4.4 4.2 3.8 4.2 4.4 4.6 3.9 4.1 4.5 4.8 3.9 4.7 4.2 4.2 4.8 4.5 3.6 4.1 4.3 3.9 4.2 4.0 4.2 4.0 4.5 4.4 4.1 4.0 4.0 3.8 4.6 4.9 3.8 4.3 4.3 3.9 3.8 4.7 3.9 4.0 4.2 4.3 4.7 4.1 4.0 4.6 4.4 4.6 4.4 4.9 4.4 4.0 3.9 4.5 4.3 3.8 4.1 4.3 4.2 4.5 4.4 4.2 4.7 3.8 4.5 4.0 4.2 4.1 4.0 4.7 4.1 4.7 4.1 4.8 4.1 4.3 4.7 4.2 4.1 4.4 4.8 4.1 4.9 4.3 4.4 4.4 4.3 4.6 4.5 4.6 4.0 ; run; proc univariate plot; var wtgain; histogram wtgain/midpoints = 3.6 to 4.9 by 0.1 cfill=darkcyan pfill = x4 ctext=deepskyblue caxes=darkgray normal(color=magenta mu=4.3 sigma=0.3); title c= firebrick 'Histogram of Chick Data using Proc Univariate '; run; SAS Log 5 6 7 8 9 data chicks; input wtgain @; label wtgain ='Weight gain (in gms) after 8-weeks'; datalines; NOTE: SAS went to a new line when INP ...