Study Guides (283,548)
CA (135,445)
York (10,978)
BIOL (591)
BIOL 2060 (18)
Joel Shore (14)
Study Guide

BIOL 2060 Study Guide - Comprehensive Midterm Guide: Cary, North Carolina, Cumulative Frequency Analysis, Proprietary Software

24 Pages
197 Views
Fall 2016

Department
Biology
Course Code
BIOL 2060
Professor
Joel Shore
Study Guide
Midterm

This preview shows pages 1-3. Sign up to view the full 24 pages of the document.
York
BIOL 2060
MIDTERM EXAM
STUDY GUIDE
Problem set #1
1)
Either type or cut-and-past this SAS program into the SAS
program editor. Click on the "running person" icon at the
top menu of SAS, and the program should run successfully.
DATA CELLPHONE;
INPUT GENDER $ WEIGHT;
CARDS;
M 12
M 14
M 10
M 9
M 13
F 11
F 15
F 13
F 12
F 11
;
PROC SORT;
BY GENDER;
PROC MEANS MEAN N STD STDERR;
PROC UNIVARIATE;
PROC MEANS MEAN N STD STDERR;
BY GENDER;
RUN;
An explanation of the various SAS statements follows:
The first statement, the DATA CELLPHONE;
The keyword DATA is recognized by SAS and it is usually the
first statement in a data set. The word that follows is one
you make up that is informative to you. It probably
shouldn't be too long, nor should it have spaces in it, nor
should it be a SAS keyword (like don't say DATA DATA;).
Note that SAS statements are typically all followed by a
semicolon ";". The lines of data are not.
INPUT statement.
INPUT is a SAS keyword that tells SAS how your data are
organized. So in my data set I had two things that
described each individual in the data set. One was their
gender (M or F) the other was the weight of the cellphone
find more resources at oneclass.com
find more resources at oneclass.com
in grams. I made up the names of the variables using names
that were informative to me, but not too long (and that
weren't SAS keywords).
Note that if one of the variables is to be read in as
alphanumeric information (i.e. it is a categorical nominal
variable) then you follow the name of that variable with a
dollar sign, $
So in the INPUT statement I said GENDER $.
WEIGHT IS A NUMERIC VARIABLE (READS IN ONLY NUMBERS) SO IT
IS JUST LISTED AS WEIGHT.
CARDS; This statement tells SAS that the data will follow
next. It is a holdover from the days when computer cards
were used. If you like, you could use the statement
DATALINES; instead of CARDS;.
Then the data follow.
The failsafe way to input your data is to have each
individual (or subject) on a separate line where you list
all the things you've measured on that individual. Then you
do the next individual and so on.
Following all the lines of data, I put a line containing
only a semi colon. This may not be necessary but I normally
do it. In this way, your data are enclosed in a statement
CARDS; and they end with a final single ;
After the data, you then tell SAS what to do with your
data. Various SAS analyses are called procedures and are
preceeded by the word PROC and then the name of the
procedure.
PROC SORT;
BY GENDER;
It is normally a good idea to sort your data and indeed a
number of SAS procedures require that it is sorted in a
particular way.
So the two statements above tells SAS to sort the data by
gender (even though I'd already input in a sorted form, I
did this any way).
PROC MEANS MEAN N STD STDERR;
find more resources at oneclass.com
find more resources at oneclass.com

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
York BIOL 2060 MIDTERM EXAM STUDY GUIDE find more resources at oneclass.com Problem set #1 1) Either type or cut-and-past this SAS program into the SAS program editor. Click on the "running person" icon at the top menu of SAS, and the program should run successfully. DATA CELLPHONE; INPUT GENDER $ WEIGHT; CARDS; M 12 M 14 M 10 M 9 M 13 F 11 F 15 F 13 F 12 F 11 ; PROC SORT; BY GENDER; PROC MEANS MEAN N STD STDERR; PROC UNIVARIATE; PROC MEANS MEAN N STD STDERR; BY GENDER; RUN; An explanation of the various SAS statements follows: The first statement, the DATA CELLPHONE; The keyword DATA is recognized by SAS and it is usually the first statement in a data set. The word that follows is one you make up that is informative to you. It probably shouldn't be too long, nor should it have spaces in it, nor should it be a SAS keyword (like don't say DATA DATA;). Note that SAS statements are typically all followed by a semicolon ";". The lines of data are not. INPUT statement. INPUT is a SAS keyword that tells SAS how your data are organized. So in my data set I had two things that described each individual in the data set. One was their gender (M or F) the other was the weight of the cellphone find more resources at oneclass.com find more resources at oneclass.com in grams. I made up the names of the variables using names that were informative to me, but not too long (and that weren't SAS keywords). Note that if one of the variables is to be read in as alphanumeric information (i.e. it is a categorical nominal variable) then you follow the name of that variable with a dollar sign, $ So in the INPUT statement I said GENDER $. WEIGHT IS A NUMERIC VARIABLE (READS IN ONLY NUMBERS) SO IT IS JUST LISTED AS WEIGHT. CARDS; This statement tells SAS that the data will follow next. It is a holdover from the days when computer cards were used. If you like, you could use the statement DATALINES; instead of CARDS;. Then the data follow. The failsafe way to input your data is to have each individual (or subject) on a separate line where you list all the things you've measured on that individual. Then you do the next individual and so on. Following all the lines of data, I put a line containing only a semi colon. This may not be necessary but I normally do it. In this way, your data are enclosed in a statement CARDS; and they end with a final single ; After the data, you then tell SAS what to do with your data. Various SAS analyses are called procedures and are preceeded by the word PROC and then the name of the procedure. PROC SORT; BY GENDER; It is normally a good idea to sort your data and indeed a number of SAS procedures require that it is sorted in a particular way. So the two statements above tells SAS to sort the data by gender (even though I'd already input in a sorted form, I did this any way). PROC MEANS MEAN N STD STDERR; find more resources at oneclass.com find more resources at oneclass.com This is from procedure MEANS and tells SAS to find the mean, sample size standard deviation (STD) and standard error of the mean (STDERR) for the whole data set. I did it for purpose of illustration. The procedure written in this way, will not do separate estimations for males and females. PROC UNIVARIATE; automatically does even more descriptive statistics including the quartiles, it measure skewness and kurtosis (two measures of departure from a normal distribution), it will test for whether the data follow a normal distribution (we'll consider this later in the course). Again, it will do it for all the data in the way I have set this up (but you could do it separately for each gender using the BY statement as in the statement below). PROC MEANS MEAN N STD STDERR; BY GENDER; In the statement above I ran PROC MEANS again, this time calculating the means etc separately for each gender, which is perhaps more useful for this data set. RUN; End the SAS program code with the word RUN; You still have to press the little running man icon at the top of the screen to run the program. NOTE: SAS is notorious for lengthy output. Avoid just printing out the output it gives you as you'll consume several forests of paper. I normally edit the output in word or somewhere and print out what I need. You will see in the output window below, that I've also reduced the font size to squeeze everything in. find more resources at oneclass.com find more resources at oneclass.com Here's the Log window contents after running the program. NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) Licensed to YORK UNIVERSITY, Site 70085278. NOTE: This session is executing on the X64_ES08R2 platform. NOTE: SAS initialization used: real time 1.96 seconds cpu time 1.57 seconds 1 DATA CELLPHONE; 2 INPUT GENDER $ WEIGHT; 3 CARDS; NOTE: The data set WORK.CELLPHONE has 10 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 14 ; 15 PROC SORT; 16 BY GENDER; NOTE: There were 10 observations read from the data set WORK.CELLPHONE. NOTE: The data set WORK.CELLPHONE has 10 observations and 2 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.62 seconds cpu time 0.11 seconds 17 PROC MEANS MEAN N STD STDERR; NOTE: Writing HTML Body file: sashtml.htm NOTE: There were 10 observations read from the data set WORK.CELLPHONE. NOTE: PROCEDURE MEANS used (Total process time): real time 1.82 seconds cpu time 0.62 seconds 18 PROC UNIVARIATE; NOTE: PROCEDURE UNIVARIATE used (Total process time): real time 1.06 seconds cpu time 0.10 seconds 19 PROC MEANS MEAN N STD STDERR; 20 BY GENDER; 21 RUN; NOTE: There were 10 observations read from the data set WORK.CELLPHONE. NOTE: PROCEDURE MEANS used (Total process time): real time 0.23 seconds cpu time 0.07 seconds find more resources at oneclass.com find more resources at oneclass.com THE FIRST PORTION OF OUTPUT IS FROM PROC MEANS The SAS System The MEANS Procedure Analysis Variable : WEIGHT Mean N Std Dev Std Error 12.0000000 10 1.8257419 0.5773503 THIS PORTION OF OUTPUT IS FROM PROC UNIVARIATE The SAS System The UNIVARIATE Procedure Variable: WEIGHT Moments N 10 Sum Weights 10 Mean 12 Sum Observations 120 Std Deviation 1.82574186 Variance 3.33333333 Skewness 0 Kurtosis -0.45 Uncorrected SS 1470 Corrected SS 30 Coeff Variation 15.2145155 Std Error Mean 0.57735027 Basic Statistical Measures Location Variability Mean 12.00000 Std Deviation 1.82574 Median 12.00000 Variance 3.33333 Mode 11.00000 Range 6.00000 Interquartile Range 2.00000 Note: The mode displayed is the smallest of 3 modes with a count of 2. Tests for Location: Mu0=0 Test Statistic p Value Student's t t 20.78461 Pr > |t| = |M| 0.0020 Signed Rank S 27.5 Pr >= |S| 0.0020 Quantiles (Definition 5) Quantile Estimate 100% Max 15.0 99% 15.0 95% 15.0 90% 14.5 75% Q3 13.0 50% Median 12.0 25% Q1 11.0 10% 9.5 5% 9.0 1% 9.0 0% Min 9.0 find more resources at oneclass.com find more resources at oneclass.com Extreme Observations Lowest Highest Value Obs Value Obs 9 9 12 6 10 8 13 3 11 5 13 10 11 1 14 7 12 6 15 2 THIS FINAL PORTION IS FOR PROC MEANS WHERE THE ANALYSIS HAVE BEEN DONE SEPARATELY FOR FEMALES (F) AND MALES (M) The SAS System The MEANS Procedure GENDER=F Analysis Variable : WEIGHT Mean N Std Dev Std Error 12.4000000 5 1.6733201 0.7483315 GENDER=M Analysis Variable : WEIGHT Mean N Std Dev Std Error 11.6000000 5 2.0736441 0.9273618 find more resources at oneclass.com find more resources at oneclass.com PLOTTING A FREQUENCY DISTRIBUTION IN SAS Here are some data obtained by rolling a "loaded" die 30 times The SAS program plots the distribution and provides a table of frequencies and cumulative frequencies. DATA STUFF; INPUT Y; CARDS; 1 1 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 6 ; PROC FREQ; TABLES Y / PLOTS=FREQPLOT; RUN; find more resources at oneclass.com find more resources at oneclass.com HERE'S WHAT WAS IN THE LOG WINDOW NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) Licensed to YORK UNIVERSITY, Site 70085278. NOTE: This session is executing on the X64_ES08R2 platform. NOTE: SAS initialization used: real time 1.68 seconds cpu time 1.21 seconds 1 DATA STUFF; 2 INPUT Y; 3 CARDS; NOTE: The data set WORK.STUFF has 30 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 34 ; 35 PROC FREQ; 36 TABLES Y / PLOTS=FREQPLOT; 37 RUN; NOTE: Writing HTML Body file: sashtml.htm NOTE: There were 30 observations read from the data set WORK.STUFF. NOTE: PROCEDURE FREQ used (Total process time): real time 2.90 seconds cpu time 0.76 seconds find more resources at oneclass.com find more resources at oneclass.com The SAS System The FREQ Procedure Y Frequency Percent Cumulative Cumulative Frequency Percent 1 2 6.67 2 6.67 2 4 13.33 6 20.00 3 7 23.33 13 43.33 4 12 40.00 25 83.33 5 4 13.33 29 96.67 6 1 3.33 30 100.00 find more resources at oneclass.com find more resources at oneclass.com Here are some additional data sets for your to analyse. Below are the final numerical grades for students in a course entitled "Extreme basket-weaving for non-majors". Plot a histogram of these data (do this by hand just to see why computers were invented, and then using sas). 26.5 80.7 59.4 75.9 40.9 61.7 34.5 87.6 81.5 86.2 54.5 34.5 70.9 87.9 48.1 50.2 73.9 80.2 68.1 53.3 57 49.9 56.5 45.8 50.1 55.1 53.2 21.5 45.1 52 81.3 65.5 49.4 56.3 51.6 49.3 78.7 88.2 82.7 58 66.1 86.2 75.5 68.1 64.4 61.8 51.1 31.5 51.3 50.8 60.2 79.1 69.3 65.9 31.5 45.7 54.2 46.1 85.1 59.6 53.7 66.1 71.2 52.9 61.8 66.3 75.5 68.6 70.9 81.3 67.2 68.9 57.3 40 61.5 60.7 62 59.4 64.4 71.2 64.9 64.7 88.8 56.4 54.2 27.7 92.7 24.4 42.5 61.8 49.4 44.1 61.8 44.7 57.5 68.8 56.4 60.8 56.1 68.1 48 49.9 43.3 64.8 51 61.7 40.8 63.6 89.8 57.6 71.8 72.2 67 83 64.1 85.9 35.9 69.5 92.3 65.7 49.9 53 44.5 72.9 54.5 59.3 58.7 47.6 66.1 69.2 35.3 88.5 62.6 56.2 52 39.7 54.5 36.3 59.5 45.2 67.4 57.1 81.3 53.2 86.6 70.2 39.5 60.5 61.1 33.4 39.3 86.8 64 92.3 77.9 64.6 45.2 54.8 79.8 39 66.4 80.9 59.7 70.5 48.7 49.6 50.7 65.8 79.6 50.8 84.7 73 56 77.6 54.8 75.8 68.5 58.6 79.6 59.1 53.5 62.7 33 75.9 41 60.6 80 74.5 47.2 52.9 58 45.5 61.9 76.7 73.3 76.2 68.3 75.6 73.5 49.9 53.3 50.9 44.4 55 53.8 30.3 50.8 58.8 68.3 51.7 66.5 52.8 45.2 73.7 76.7 88.4 55.7 77.6 56 67.2 88.1 62.1 73.8 60.4 72.2 66.7 49.7 49.8 41 49.5 62.7 42.5 45.1 83.8 53.8 find more resources at oneclass.com find more resources at oneclass.com 67.5 76.5 67.4 72 70.8 42.9 73.4 42.6 56.2 46.5 67.7 82 54.9 30.4 46 66.3 65.8 62.4 77.3 44 Plot a histogram of these data using sas. Since these are continuous numerical data we use a different procedure to plot them. You can set up the sas data set as before. Note that if you want to put the data in exactly as above your input statement should read as follows: INPUT GRADES @@; The "@@" simbols tells SAS that the data for GRADES are not in a single column but rather follow one after the other. This form of input can be used when you are input the values of just a single variable and you don't want to have the data in a single large column of numbers. Use proc univariate to plot the histogram. Use the statements: PROC UNIVARIATE; HISTOGRAM / VSCALE = COUNT; Above, the key word histogram tells sas to plot a histogram. The keywords VSCALE = COUNT tell
More Less
Unlock Document
Subscribers Only

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

Unlock Document
Subscribers Only
You're Reading a Preview

Unlock to view full version

Unlock Document
Subscribers Only

You've reached the limit of 4 previews this month

Create an account for unlimited previews.

Already have an account?

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit