stat.desc(noiserel)
cor(noiserel)
m <- 5
b <- 3
xvals <- rnorm(100, 50, 10)
yvals <- xvals * m + 3
rel <- data.frame(list(x=xvals, y=yvals))
summary(rel)
cor(rel)
nyvals <- xvals * m + 3 + rnorm(length(xvals), 0, 20)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
cor(noiserel)
plot(noiserel)
2**3
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
nyvals <- xvals * m + 3 + rnorm(length(xvals), 0, noise_sd)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 0.9)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
print(noise_sd)
nyvals <- xvals * m + 3 + rnorm(length(xvals), 0, noise_sd)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 0.9)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
print(noise_sd)
nyvals <- xvals * m + 3 + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- xvals * m + 3 + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
nyvals <- yvals + rnorm(length(xvals), 0, target)
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - noise**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - sd(noise)**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - sd(noise)**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - sd(noise)**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - sd(noise)**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
cplot <- function(slope, offset, avg, sd, target) {
xvals <- rnorm(100, avg, sd)
yvals <- xvals * slope + offset
rel <- data.frame(list(x=xvals, y=yvals))
cor(rel)
mvar <- sd * slope
# noise_sd <- sqrt((mvar - mvar* target**2) / target**2)
# print(noise_sd)
noise <- rnorm(length(xvals), 0, target)
nyvals <- yvals + noise
my_r <- sqrt(sd(yvals)**2 / sd(nyvals)**2)
print(my_r)
my_r2 <- sqrt((sd(nyvals)**2  - target**2)/ sd(nyvals)**2)
print(my_r2)
my_r3 <- sqrt((sd(nyvals)**2  - sd(noise)**2)/ sd(nyvals)**2)
print(my_r3)
noiserel <- data.frame(list(x=xvals, y=nyvals))
summary(noiserel)
stat.desc(noiserel)
ctable <- cor(noiserel)
plot(noiserel)
return(ctable)
}
cplot(2, 5, 50, 10, 20)
clist <- list(ICL_k = c("Q1_K", "Q2_K"), ECL_k = c("Q3_K", "Q4_K", "Q5_K"))
clist
cl_df <- data.frame(
survey = c('Klepsch', 'Morisson'),
intrinsic = list(c("Q1_K", "Q2_K"), c("Q1_M", "Q2_M","Q3_M")),
germane = list(c("Q6_K", "Q7_K", "Q8_K"), c("Q7_M", "Q8_M", "Q9_M", "Q10_M")),
exgtraneous = list(c("Q3_K", "Q4_K", "Q5_K"), c("Q4_M", "Q5_M", "Q6_M"))
)
cl_df <- data.frame(
survey = c('Klepsch', 'Morisson'),
intrinsic = c(c("Q1_K", "Q2_K"), c("Q1_M", "Q2_M","Q3_M")),
germane = c(c("Q6_K", "Q7_K", "Q8_K"), c("Q7_M", "Q8_M", "Q9_M", "Q10_M")),
exgtraneous = c(c("Q3_K", "Q4_K", "Q5_K"), c("Q4_M", "Q5_M", "Q6_M"))
)
cl_df <- data.frame(
survey = c('Klepsch', 'Morisson'),
intrinsic = c(list("Q1_K", "Q2_K"), list("Q1_M", "Q2_M","Q3_M")),
germane = c(list("Q6_K", "Q7_K", "Q8_K"), list("Q7_M", "Q8_M", "Q9_M", "Q10_M")),
exgtraneous = c(list("Q3_K", "Q4_K", "Q5_K"), list("Q4_M", "Q5_M", "Q6_M"))
)
unlist((list('x', 'y', 'z')))
cl_df
alphaC <- function(col_list) {}
alphaC <- function(col_list) {
alpha::psych(alltotals[, unlist(col_list)]))$total$raw_alpha
alphaC <- function(col_list) {
alpha::psych(alltotals[, unlist(col_list)])$total$raw_alpha
}
alphaC(cl_df[, 1])
alphaC <- function(col_list) {
psych::alpha(alltotals[, unlist(col_list)])$total$raw_alpha
}
alphaC(cl_df[, 1])
alltotals
alltotals <- read.csv("Fall_2024_Data.csv")
alphaC(cl_df[, 1])
alphaC(cl_df[, 2])
alphaC(cl_df[1, 2])
cl_df[1,2]
cl_df[,2]
cl_df[,'intrinsic']
cl_df[, c('intrinsic')]
cl_df <- data.frame(
survey = c('Klepsch', 'Morisson'),
intrinsic = c(list("Q1_K", "Q2_K"), list("Q1_M", "Q2_M","Q3_M")),
germane = c(list("Q6_K", "Q7_K", "Q8_K"), list("Q7_M", "Q8_M", "Q9_M", "Q10_M")),
extraneous = c(list("Q3_K", "Q4_K", "Q5_K"), list("Q4_M", "Q5_M", "Q6_M"))
)
cl_df[1]
cl_df[2]
cl_df['survey']
cl_df[c('survey')]
cl_df[c('survey', 'intrinsic')]
v1 <- c(list("Q1_K", "Q2_K"), list("Q1_M", "Q2_M","Q3_M"))
v1
v2 <- c(c("Q1_K", "Q2_K"), c("Q1_M", "Q2_M","Q3_M"))
v2
v1[1]
v3 <- I(c(list("Q1_K", "Q2_K"), list("Q1_M", "Q2_M","Q3_M")))
v3
v1
v4 <- (c(I(list("Q1_K", "Q2_K")), I(list("Q1_M", "Q2_M","Q3_M")))
)
v4
v4 <- c(I(list("Q1_K", "Q2_K")), I(list("Q1_M", "Q2_M","Q3_M")))
v4
times = c(10, 15, 20)
times + c(5, 10)
times + c(5)
times + 5
times2 = c(10, 15, 20, 25)
times2 + c(1, 2)
summary(c(474, 305, 30, 35, 45, 25, 34, 39, 33, 38, 26, 33, 113, 135, 34, 33, 42, 34, 37, 38))
sd(c(474, 305, 30, 35, 45, 25, 34, 39, 33, 38, 26, 33, 113, 135, 34, 33, 42, 34, 37, 38))
df <- read.csv(file="TestScores.csv", header=TRUE)
setwd("~/Library/CloudStorage/OneDrive-DePaulUniversity/Documents/courses/it223/regression")
zfun <- function(score, col)
(score - mean(col)) / sd(col)
df <- read.csv(file="TestScores.csv", header=TRUE)
summary(df)
midterm <- df$Midterm
midterm
summary(midterm)
sd(midterm)
zfun <- function(score, col)
(score - mean(col)) / sd(col)
zfun(20, midterm)
sapply(midterm, zfun, col = midterm)
plot(sapply(midterm, zfun, col = midterm), midterm)
qqnorm(midterm)
plot(pnorm(sapply(midterm, zfun, col = midterm)), midterm)
qnorm(.5)
qnorm(0.025)
df <- read.csv(file="midtermAnswers242.csv", header=TRUE)
setwd("~/Library/CloudStorage/OneDrive-DePaulUniversity/Documents/courses/it223/midterm_scores")
summary(df)
df <- read.csv(file="TestScores.csv", header=TRUE)
setwd("~/Library/CloudStorage/OneDrive-DePaulUniversity/Documents/courses/it223/regression")
df <- read.csv(file="TestScores.csv", header=TRUE)
summary(df)
df <- read.csv(file="midtermAnswers242.csv", header=TRUE)
setwd("~/Library/CloudStorage/OneDrive-DePaulUniversity/Documents/courses/it223/midterm_scores")
df <- read.csv(file="midtermAnswers242.csv", header=TRUE)
summary(df)
plot(df$Predict.Output, df$Write.Code)
model <- lm(df$Write.Code~df$Predict.Output)
model
summary(model)
setwd(dirname(rstudioapi::getSourceEditorContext()$path))
df <- read.csv(file="qTypeComp.csv", header=TRUE)
setwd(dirname(rstudioapi::getSourceEditorContext()$path))  # sets working directory
df <- read.csv(file="qTypeComp.csv", header=TRUE)
predict_scores <- df$Predict.Output
write_scores <- df$Write.Code
plot(predict_scores, write_scores)
