Skip to content

Instantly share code, notes, and snippets.

View miray-o's full-sized avatar

Miray Ozmutlu miray-o

View GitHub Profile
@miray-o
miray-o / cs130_assignment_2.R
Created October 21, 2025 11:27
The complete R code for midterm assignment
#---Question 5:
# Set a seed for reproducibility of the random data.
set.seed(42)
# Define the number of observations.
n <- 2000
# Create the primary predictor variable X1 (years of education) from a normal distribution.
X1 <- rnorm(n, mean = 0, sd = 1)
@miray-o
miray-o / cs130_assignment_1.R
Last active September 20, 2025 23:36
Contains my R code for CS130 Assignment 1
#1. Data Exploration
# install.packages("medicaldata")
library(medicaldata)
library(ggplot2)
data(laryngoscope)
?laryngoscope #check the documentation of the dataset
dim(laryngoscope) #check the dimensions of the dataset
#2. Data Analysis
nrow(laryngoscope[laryngoscope$gender == 0, ]) #calculate the number of female patients