eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2], aRange=0.1,
grid = list(x=seq(-1, 2, length.out = m),
y=seq(-1, 2, length.out = m)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/10) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/10) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2], aRange=0.1,
grid = list(x=seq(0,1, length.out = m),
y=seq(0,1, length.out = m)))
contact[,1]
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2], aRange=0.1,
grid = list(x=seq(0,1, length.out = m),
y=seq(0,1, length.out = m)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/10) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/0.02882709) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/10) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/15) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)/10) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(max(EDR)/TD)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2], aRange=0.15,
grid = list(x=seq(0,1, length.out = m),
y=seq(0,1, length.out = m)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(max(EDR)/TD)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.2,
grid = list(x=seq(0,1, length.out = m),
y=seq(0,1, length.out = m)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(max(EDR)/TD)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
seq(0,1, length.out = m)
0.02040816*0.02040816
0.02040816*0.02040816 * sum(TR_1$density_Ri_new_expit)
seq(0,1, length.out = 51)
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * 0.02^2)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
# Cross-sectional contact
m = 51
contact = expand.grid(x1 = seq(0,1, length.out = m),
x2 = seq(0,1, length.out = m))
contact = as.matrix(contact)
dist_contact = as.matrix(dist(rbind(x, contact),
method = dist_type, diag = T, upper = T))
# Transport Rank
TR_1 = TR(dist_contact[1:n,1:n], dist_contact[(n+1):(n+nrow(contact)),1:n])
ER_surface = function(x){
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,
x=contact[,1:2], aRange=0.1,
grid = list(x=c(x[1]-1,x[1],x[1]+1), y=c(x[2]-1,x[2],x[2]+1)))
return(eig.sm.df$z[2,2])
}
# out.n2 = m * 3
# out.n1 = m * 3
# eig.sm.df = smooth.2d(Y = TR_1$density_Ri_new_expit,
#                       x = contact[,1:2],
#                       nrow = out.n2,
#                       ncol = out.n1,
#                       theta = 6)
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.2,
grid = list(x=seq(0,1, length.out = 3*m),
y=seq(0,1, length.out = 3*m)))
df = data.frame(x = contact[,1],
y = contact[,2],
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(3*m-1))^2)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = eig.sm.df$x,
y = eig.sm.df$y,
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(3*m-1))^2)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
View(eig.sm.df)
df = data.frame(x = rep(eig.sm.df$x, 3*m),
y = rep(eig.sm.df$y, each = 3*m),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(3*m-1))^2)) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
sum(as.vector(eig.sm.df$z))
sum(as.vector(eig.sm.df$z)) * (1/(3*m-1))^2
df = data.frame(x = rep(eig.sm.df$x, 3*m),
y = rep(eig.sm.df$y, each = 3*m),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(3*m-1))^2)) %>%
mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
# out.n2 = m * 3
# out.n1 = m * 3
# eig.sm.df = smooth.2d(Y = TR_1$density_Ri_new_expit,
#                       x = contact[,1:2],
#                       nrow = out.n2,
#                       ncol = out.n1,
#                       theta = 6)
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.1,
grid = list(x=seq(0,1, length.out = 3*m),
y=seq(0,1, length.out = 3*m)))
df = data.frame(x = rep(eig.sm.df$x, 3*m),
y = rep(eig.sm.df$y, each = 3*m),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(3*m-1))^2)) %>%
mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
# out.n2 = m * 3
# out.n1 = m * 3
# eig.sm.df = smooth.2d(Y = TR_1$density_Ri_new_expit,
#                       x = contact[,1:2],
#                       nrow = out.n2,
#                       ncol = out.n1,
#                       theta = 6)
out.n = 2*m
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.1,
grid = list(x=seq(0,1, length.out = out.n),
y=seq(0,1, length.out = out.n)))
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
# mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.05,
grid = list(x=seq(0,1, length.out = out.n),
y=seq(0,1, length.out = out.n)))
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
# mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
(sum(TR_1$density_Ri_new_expit) * (1/(out.n-1))^2)
(sum(as.vector(eig.sm.df$z)) * (1/(out.n-1))^2)
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
mutate(EDR = EDR/11) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.1,
grid = list(x=seq(0,1, length.out = out.n),
y=seq(0,1, length.out = out.n)))
(sum(as.vector(eig.sm.df$z)) * (1/(out.n-1))^2)
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
mutate(EDR = EDR/11) %>%
gather(key = "type", value = "density", -x, -y)
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
# mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
# out.n2 = m * 3
# out.n1 = m * 3
# eig.sm.df = smooth.2d(Y = TR_1$density_Ri_new_expit,
#                       x = contact[,1:2],
#                       nrow = out.n2,
#                       ncol = out.n1,
#                       theta = 6)
out.n = m
eig.sm.df = smooth.2d(TR_1$density_Ri_new_expit,  x=contact[,1:2],
aRange=0.1,
grid = list(x=seq(0,1, length.out = out.n),
y=seq(0,1, length.out = out.n)))
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
# mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
(sum(as.vector(eig.sm.df$z)) * (1/(out.n-1))^2)
df = data.frame(x = rep(eig.sm.df$x, out.n),
y = rep(eig.sm.df$y, each = out.n),
EDR = as.vector(eig.sm.df$z)) %>%
mutate(TD = true_density(data.frame(x1=x, x2=y))) %>%
# mutate(EDR = EDR/(sum(EDR) * (1/(out.n-1))^2)) %>%
mutate(EDR = EDR/10) %>%
gather(key = "type", value = "density", -x, -y)
ggplot(df) +
geom_tile(aes(x = y, y = x, fill = density)) +
facet_wrap(~type) +
scico::scale_fill_scico(limits = c(min(df$density), max(df$density)),
palette = "lajolla", direction = -1) +
scale_y_continuous(limits=c(0,1)) +
scale_x_continuous(limits=c(0,1)) +
#ggtitle(paste0("eigenfunction ", "K", k)) +
theme(plot.title = element_text(hjust = 0.5),
panel.background = element_rect(fill = 'white') )
source("~/Google Drive/Random Object Density/NHANES/NHANES_density.R")
patients101 <- read.csv("~/Google Drive/UCDavis/STA100A-2024spring/discussion/discussion0_R/patients101.csv")
View(patients101)
knitr::opts_chunk$set(echo = TRUE, message=FALSE, comment = NA,
fig.height = 3, fig.width = 5, fig.align = "center")
# summary table of petal width
summary.table = summary(patients101$weight)
summary.table
IQR = as.numeric(summary.table[5] - summary.table[2])
IQR
patients101$gender
ggplot(patients101) +
geom_box(aes(x = gender, y = height)) +
labs(title = "Boxplot of Patients' Height by Gender") +
theme(plot.title = element_text(hjust = 0.5))
# Packages required for this homework
library(ggplot2)
# Load the patients101 dataset
patients101 = read.csv("~/Google Drive/UCDavis/STA100A-2024spring/discussion/discussion0_R/patients101.csv")
# Visualize the six rows of the dataset
head(patients101)
ggplot(patients101) +
geom_box(aes(x = gender, y = height)) +
labs(title = "Boxplot of Patients' Height by Gender") +
theme(plot.title = element_text(hjust = 0.5))
ggplot(patients101) +
geom_boxplot(aes(x = gender, y = height)) +
labs(title = "Boxplot of Patients' Height by Gender") +
theme(plot.title = element_text(hjust = 0.5))
ggplot(patients101) +
geom_boxplot(aes(x = gender, y = height)) +
labs(title = "Boxplot of Patients' Height by Gender",
x = "Gender", y = "Height") +
theme(plot.title = element_text(hjust = 0.5))
library(plyr)
library(tidyr)
library(dplyr)
library(ggplot2)
library(plotly)
library(knitr)
library(hrbrthemes)
library(reshape2)
library(igraph)
library(chron)
library(dimRed)
library(foreach)
library(doSNOW)
# ncores = 5
# cl = makeCluster(ncores)
# registerDoSNOW(cl)
text = "LOOCV - r = %d is complete\n"
progress = function(r) {
if(r%%100 == 0){
cat(sprintf(text, r))
}
}
opts = list(progress=progress)
setwd("~/Google Drive/Deep Frechet/Network-Regression-with-Graph-Laplacians/")
source('src/gnr.R')
source('src/lnr.R')
source("src/kerFctn.R")
