New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Biostats Weeks 1-4 notes

by: Kiara Lynch

Biostats Weeks 1-4 notes BIO 472

Marketplace > La Salle University > Biology > BIO 472 > Biostats Weeks 1 4 notes
Kiara Lynch
La Salle
View Full Document for 0 Karma

View Full Document


Unlock These Notes for FREE

Enter your email below and we will instantly email you these Notes for Biostatistics

(Limited time offer)

Unlock Notes

Already have a StudySoup account? Login here

Unlock FREE Class Notes

Enter your email below to receive Biostatistics notes

Everyone needs better class notes. Enter your email and we will send you notes for this class for free.

Unlock FREE notes

About this Document

These notes go along with the PowerPoint lectures from class on canvas and notes that go along with "R" scripts.
Class Notes




Popular in Biostatistics

Popular in Biology

This 9 page Class Notes was uploaded by Kiara Lynch on Thursday February 11, 2016. The Class Notes belongs to BIO 472 at La Salle University taught by in Summer 2015. Since its upload, it has received 47 views. For similar materials see Biostatistics in Biology at La Salle University.


Reviews for Biostats Weeks 1-4 notes


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: 02/11/16
1/29 pima<­read.csv("pima.csv",header=T) names(pima) attach(pima) mean(glu) sd(glu) mean(bmi) sd(bmi) length(type) levels(type) tapply(type, type, length) count.type<­tapply(type, type, length) count.type count.type/length(type) means.glu<­tapply(glu, type, mean) mean(glu) means.glu<­tapply(type, type, mean) tapply(glu, type, mean) tapply(glu, type, var) var(glu) tapply(glu, type, sd) boxplot(glu~type) pima<-read.csv("pima.csv",header=T) attach(pima) hist(glu, col="blue", main="Glucose Concentration in Pima Indian Women", xlab="Glucose Concentration", ylim=c(0,50)) boxplot(glu~type, main="Glucose Concentration in Individuals With and Without Diabetes", ylab="Glucose Concentration", col=c("blue","yellow"), names=c("Not Diabetic", "Diabetic")) means<-tapply(glu,type,mean) barplot(means) std<-tapply(glu,type,sd) means std bp.glu<-barplot(means, ylim=c(0,160), ylab="Glucose Concentration", names=c("Not Diabetic","Diabetic"), main="Glucose Concentration in Individuals With and Without diabetes", col=c("blue","green")) segments(bp.glu, means-std, bp.glu, means+std, lwd=3) 2/3/16 binomials dbinom(5,6,0.5) #probability of getting 5 heads in 6 tosses where probability of getting a heads is 0.5 dbinom(4,6,0.5) #successes, number of events, probability of success dbinom(6,6,0.5) dbinom(2,6,0.5)+dbinom(3,6,0.5)+dbinom(4,6,0.5) #prob of getting a 2,3,or 4 heads in 6 tosses X<-0:6 #discrete whole values X probs<-dbinom(X,6,0.5) probs barplot(probs, xlab="Number of Heads", names=X, col=c(rep("darkseagreen1",3),rep("cadetblue1",4)), #rep= repeat seagreen 3x and cadetblue 4x ylab="Probability", cex.lab=1.2, #changes font size of axis labels cex.names=1.2, #changes font size of x axis values cex.axis=1.2, #changes font size of y axis values axis.lty=1) #adds line and tick marks to x axis pbinom(2,6,0.5) #prob of getting less than or equal to 2 dbinom(3,6,.5)+dbinom(4,6,.5)+dbinom(5,6,.5)+dbinom(6,6,.5) #prob of getting greater than 2 pbinom(2,6,.5,lower.tail=F) #prob of getting greater than 2 (not greater than or equal to) 2/5/16 scatterplot 2 numeric (continuous or discrete) variables explanatory: plotted on x axis response: plotted on y axis assesses strength and direction of the relationship b/w the variables (linear or polynomial) a<-read.csv("standardcurve.csv",header=T) a attach(a) plot(Absorbance~Concentration, #plot(y variable~x variable) pch=23, #shape of dots bg="slateblue4", #color of dots cex=1.3) #change size of points model<-lm(Absorbance~Concentration) #linear model (y variable~x variable) model$coefficients #gives intercept and concentration abline(model, #standard curve lwd=2, #thickness of line col="magenta") #color of standard curve plot(Absorbance~Concentration, type="n", #makes labels but won't plot points main="AbsxConcentration") #title b<-par("usr") #coordinates of 4 corners of box rect(b[1],b[3],b[2],b[4], col="powderblue") points(Absorbance~Concentration, pch=21, bg="slateblue4") abline(model, lwd=2, lty=3, #changes line type (solid/dashed) col="mediumvioletred") normal distribution continuous bell shape width based on standard deviation 68% of individuals in population fall between -1 and +1 sd of mean 95% between +- 2 sd of mean 99.7% between +- 3 sd of mean pnorm(70,100,15) #prob of getting that value or less (value, mean, sd) pnorm(130,100,15) #IQ of 130 --> 97th percentile pnorm(130,100,15, #IQ of at least 130= 2% lower.tail=F) notes 2/8 two parameters for binomial distribution n and p (number of times, and probability of success) continuous probability- normal distribution probability of an event or more extreme or an area between two events tails extend forever in both directions area under curve (sample space) is still 1 population mean and population standard deviation determine shape and position of curve cannot have a probability (p value) of 0 (<.0001) sd increases, p value decreases (taller and skinnier curve) Null hypothesis data you collect will either support or refute it ex: scientific hypothesis- relationship between blood pressure and diet statistical null hypothesis- there is no relationship between blood pressure and diet any outcome is random made in reference to population parameter--> use sample to estimate this use sample size to estimate true mean Mean: , µ (mu) Standard Deviation: s, σ (lower-case sigma) Regression Coefficients: b, β (Beta) Proportion: p , p Correlation Coefficient: r, ρ (rho) confidence interval- estimate unknown parameter compare sample mean to hypothesis mean calculate mean and sd calculate confidence interval sample mean plus or minus margin of error Type 1 error- reject null hypothesis when null hypothesis is true Type 2 error- failing to reject null hypothesis when it is false large sample sizes give small p values T distribution- sampling distribution 2/10 t­probability         ratio of difference between two values and measure variability         if sample mean­hypothetical mean is large ­­> large t statistic         compare to t probability distribution (large t­­> small p)         mean = 0; extreme values­­> sample mean significantly different from hypothetical mean degrees of freedom         for 1 sample t test = (n­1) assess null hypothesis         (sample mean­hypothetical mean)/standard error         p value from t statistic         calculate confidence interval         excel gives 3 p values                 3 alternatives to the statement of equality (choose 1)                     if you believe sample mean will be larger than hypothetical mean choose 1 sided t  test                                                                                    smaller                     if you have no prior prediction than choose 2 sided hypothesis (calculates both  potential p values and add them together) Assumptions         random sample; observations should be independent (outcome of 1 individual does not  influence outcome of other individual)         samples/individuals should be sampled from a distribution that is approximately normal                 make histogram (is there a bell shaped distribution?)                 calculate Shapiro­Wilk test (null hypothesis is that the distribution is normal; p  value>0.5 then you can do 1 sample t test) Report          sample mean         standard error (R DOES NOT AUTOMATICALLY CALCULATE THIS VALUE)                  report standard error not standard deviation                 also a measure of variability         t­statistic         degrees of freedom             confidence interval         p value          P<-read.csv("pima.csv",header=T) attach(P) names(P) hist(bmi, col="cyan") shapiro.test(bmi) #shapiro-wilk test-assesses normality; p value must be > 0.05 summary(bmi) #gives 5 values and the mean t.test(bmi,mu=30, #t.test(variable, mu=_ alternative="two.sided") #alternative hypothesis: true mean is greater than _ #greater, less, two.sided (value is twice as large) #reject null hypothesis bc p value <.05 #if sample is random we can calculate interval where it is likely that the true mean falls- confidence interv #reject null hypothesis bc hypothetical mean is not bw confidence interval #with 95% confidence we can say true mean falls between 2 values from 2 sided t test S<-sd(bmi) #make S and N objects N<-length(bmi) Se<-S/sqrt(N) #calculate standard error Se #standard error of the mean t.test(bmi, mu=30, #big sample size--> small p value alternative="two.sided", conf.level=.99) #change confidence level #p value smaller than .5 --> not significant 2/12 pima<-read.csv("pima.csv",header=T) attach(pima) names(pima) shapiro.test(bp) #p value > .05 hist(bp, col=c("lightblue","lightseagreen"), ylim=c(0,70)) t.test(bp, mu=95, alternative="two.sided") #does not equal, do "two.sided"; > then "greater"; < sign then "less" #95% confidence that mean is between this interval #bp is sig. different than 95 platelet<-read.csv("platelet.csv",header=T) attach(platelet) platelet Diff<-Before-After Diff hist(Diff, col=c("lightblue","lightseagreen")) shapiro.test(Diff) t.test(Diff, mu=0, alternative="two.sided") #significantly different, 0 does not fall between interval t.test(Before,After, paired=T, 2/15 t= mean difference/ standard error two sample t-test t= entire sample size - 2 p value <.05 then can't do two sample t test library(car) #for the leveneTest() Bumpus<-read.csv("bumpus.csv",header=T) attach(Bumpus) Males<-subset(Bumpus, Sex=="m") #subset for normality assessment Females<-subset(Bumpus, Sex=="f") hist(Males$TotalLength_mm) hist(Females$TotalLength_mm) shapiro.test(Males$TotalLength_mm) #gives p-value and W; cannot do 1 sample t test bc p value is below . 05 shapiro.test(Females$TotalLength_mm) hist(Males$AlarExtent_mm) hist(Females$AlarExtent_mm) shapiro.test(Males$AlarExtent_mm) #can do t test bc p value > .05 shapiro.test(Females$AlarExtent_mm) homogeneity/equal variance leveneTest(AlarExtent_mm~Sex) #if p-value is <.05, welch's t test #if p-value is >.05, 2 sample t test boxplot(AlarExtent_mm~Sex, col="lightseagreen", ylab="Alar Extent (mm)", #y label cex.axis=1.3, #font size of axis main="Male vs Female Alar Extent", #title of boxplot names=c("females","males")) #x axis variable names t.test(AlarExtent_mm~Sex, #two sample t test var.equal=T, #bc variances are ~ equal, levene alternative="less") #bc prior prediction of females smaller than males; if no prior prediction then "two.sided" t.test(AlarExtent_mm~Sex, #Welch's two sample t test alternative="less") #reject null hypothesis bc 0 is not in confidence interval


Buy Material

Are you sure you want to buy this material for

0 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


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'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Janice Dongeun University of Washington

"I used the money I made selling my notes & study guides to pay for spring break in Olympia, Washington...which was Sweet!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Parker Thompson 500 Startups

"It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.