Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary STA2020 coding

Rating
-
Sold
-
Pages
3
Uploaded on
15-05-2024
Written in
2023/2024

STA2020 coding for labs

Institution
Course

Content preview

Week 2:

drywide <- read.csv("drying_times_wide.csv")
mean(drywide$Paint.1)
mean(drywide$Paint.2)
sd(drywide$Paint.1)

drylong <- read.csv("drying_times_long.csv")
View(drylong)
t <- aov(drying_time ~ paint , data= drylong)
summary( t)


Week 3:

oat_variety<-read.csv (‘oat_variety.csv’)
View(oat_variety)
variety <- as.factor(oat_variety$variety)
mean(oat_variety$yield [oat_variety$variety == "Golden.rain"])
mean(oat_variety$yield [oat_variety$variety == "Marvellous"])
mean(oat_variety$yield [oat_variety$variety == "Victory"])
sd(oat_variety$yield [oat_variety$variety == "Golden.rain"])
t <- aov(yield ~ variety + plot , data = oat_variety)
summary( t)


Week 4:

insects<-read.csv(‘insects_data.csv’)
mean(insects$counts [insects$species == "Megacrania" & insects$season == "Spring"])
mean(insects$counts [insects$species == "Extatosoma" & insects$season == "Autumn"]) spelificmean
t <- aov(counts ~ species + season + species*season, data = insects_data)
summary( t)
IwayAnova
Week 5:

Install readxl package
library(readxl)
calls<-read_excel(‘calls.xlsx’)
mean(calls$Calls)
t <- lm(Executions ~ Calls)
im independent dependent simple linear regression
summary( t)
cor(y=calls$Executions, x=calls$Calls)
regression <- lm(Executions~Calls, data=calls)
summary(regression)
con nt(regression)
plot(x=calls$Calls, y=calls$Executions)
xlab= “number of phone calls”, ylab= “number of executions”


Week 6:

View(multreg)
df <- read.csv("multreg.csv")
View(df)
mult.numeric <- df[ , c("Price", "PlotSize", "FloorArea", "Trees", "Distance")]
cor.multi.numeric <- cor(mult.numeric)
multiple linearregression
cor(mult.numeric)
df$Pool <- as.factor(df$Pool) convertingnumericvariables to fan or variables
contrasts(df$Pool)
t <- lm(Price ~ PlotSize + FloorArea + Trees + Distance + Pool + PlotSize*FloorArea, data = df)
summary( t)
imlynxdata
con nt( t)
predict( t)
torind estimateddependentvariable

Week 7:

log <- read.csv("logreg.csv")
View(log)
dep explanatory
t <- glm(cases ~ sex + income , data = log, family = "binomial" )
logistic regression
summary( t)

mb_data <- read.csv('step.csv')
str(mb_data)
mb_data$medschl <- as.factor(mb_data$medschl)
mb_data$region <- as.factor(mb_data$region)
t.full <- lm(length ~ . , mb_data) modelbuilding
summary( t.full)
t.empty <- lm(length ~ 1, mb_data) stepwiseregression
step.model <- step( t.empty, scope = formula( t.full), direction = 'forward')
summary(step.model)

Written for

Institution
Course

Document information

Uploaded on
May 15, 2024
Number of pages
3
Written in
2023/2024
Type
SUMMARY

Subjects

$7.94
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
hslisa001

Get to know the seller

Seller avatar
hslisa001 University of Cape Town
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
2 year
Number of followers
1
Documents
18
Last sold
5 months ago

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions