Publications by Yinda Chen

Discussion 15

18.12.2023

I. A. data <- mtcars summary(data) ## mpg cyl disp hp ## Min. :10.40 Min. :4.000 Min. : 71.1 Min. : 52.0 ## 1st Qu.:15.43 1st Qu.:4.000 1st Qu.:120.8 1st Qu.: 96.5 ## Median :19.20 Median :6.000 Median :196.3 Median :123.0 ## Mean :20.09 Mean :6.188 M...

1610 sym

Discussion 14

12.12.2023

I. 1. # Load necessary libraries library(datasets) library(stargazer) ## ## Please cite as: ## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables. ## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer # Load the mtcars dataset data(mtcars) # View summary statistics of the dataset s...

2169 sym R (3752 sym/11 pcs) 4 img

Discussion 13

05.12.2023

A. library(stargazer) ## ## Please cite as: ## Hlavac, Marek (2022). stargazer: Well-Formatted Regression and Summary Statistics Tables. ## R package version 5.2.3. https://CRAN.R-project.org/package=stargazer data <- cars stargazer(data = data, type = "text", title = "Table 1: Data Summary Statistics") ## ## Table 1: Data Summary Statistics...

620 sym R (1560 sym/12 pcs)

Discussion 12

26.11.2023

1. Correlation: It indicates how two or more variables are related. Correlation can be positive (both variables move in the same direction) or negative (move in opposite directions). The strength of the correlation ranges from -1 to +1, with values close to 0 indicating a weaker correlation. Correlation measures relationships without implying ...

747 sym R (9401 sym/12 pcs)

Discussion 11

21.11.2023

library(tidyverse) ## Warning: package 'tidyverse' was built under R version 4.3.2 ## Warning: package 'tidyr' was built under R version 4.3.2 ## Warning: package 'readr' was built under R version 4.3.2 ## Warning: package 'purrr' was built under R version 4.3.2 ## Warning: package 'dplyr' was built under R version 4.3.2 ## Warning: package 'forcat...

597 sym R (3332 sym/19 pcs) 1 img

HW5

21.11.2023

Q1: mean_sample <- 110 mean_population <- 109 std_dev <- 6 sample_size <- 190 alpha <- 0.05 z <- (mean_sample - mean_population) / (std_dev / sqrt(sample_size)) p_value <- 2 * (1 - pnorm(abs(z))) decision <- ifelse(p_value < alpha, "reject", "fail to reject") cat(" Z-score:", z, "\n","P-value:", p_value, "\n","Decision:", decision, "\n"...

98 sym

Discussion 10

12.11.2023

Part 1 library(ggplot2) x <- seq(-5, 5, length.out = 200) data_normal <- data.frame(x = x, y = dnorm(x), distribution = 'Normal') dof_values <- c(2, 5, 15, 30, 120) data_t <- do.call(rbind, lapply(dof_values, function(dof) { data.frame(x = x, y = dt(x, df = dof), distribution = paste('t (df =', dof, ')')) })) data_all <- rbind(data_norma...

692 sym R (1295 sym/2 pcs) 2 img

Dis9

07.11.2023

You increase the number of trials or observations, the average of the results gets closer to the expected value or the theoretical mean. As the sample size grows, the distribution of the sample mean will tend to be approximately normal, even if the population from which the sample is drawn is not normally distributed. The sample mean’s distr...

1738 sym 2 img

Dis8

07.11.2023

I. Probability sampling is a sampling technique in which every member of the population has a known and non-zero chance of being selected. The key feature of probability sampling is that it allows for the calculation of the sampling error and, therefore, the statistical generalization of results to the population. Non-probability sampling is ...

2598 sym R (834 sym/11 pcs) 1 img

HW3

17.10.2023

# Parameters n <- 20 p <- 0.50 k_values <- 9:12 # Calculate binomial probabilities for each k probabilities <- dbinom(k_values, n, p) # Sum the probabilities total_probability <- sum(probabilities) ans <- round(total_probability, 4) print(ans) ## [1] 0.6167 So, there’s a 61.67% chance that between 9 and 12 buyers out of the 20 randoml...

1297 sym