Publications by purevdorj
HW01
R Markdown Homework ## Warning: package 'wooldridge' was built under R version 4.4.1 ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union ## psoda pfries pentree wagest nmgrs nr...
223 sym Python (5768 sym/15 pcs)
Document
# Load necessary libraries library(wooldridge) # For accessing the WAGE2 dataset library(dplyr) # For data manipulation (optional) ## ## Attaching package: 'dplyr' ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal,...
37 sym R (4893 sym/34 pcs)
Homework_1
Homework1 "C2" ## [1] "C2" '1' ## [1] "1" library(wooldridge) ## Warning: package 'wooldridge' was built under R version 4.4.1 num_women <- nrow(bwght) num_smokers <- sum(bwght$smoke == 1, na.rm = TRUE) num_women ## [1] 1388 num_smokers ## [1] 0 '2' ## [1] "2" avg_cigs <- mean(bwght$cigs, na.rm = TRUE) avg_cigs ## [1] 2.087176 median_cigs <- med...
89 sym R (1967 sym/74 pcs)
make up
Make up library(glmnet) ## Loading required package: Matrix ## Loaded glmnet 4.1-8 set.seed(42) n <- 1000 p <- 5000 real_p <- 15 x <- matrix(rnorm(n*p), nrow=n, ncol=p) y <- apply(x[,1:real_p], 1, sum) + rnorm(n) train_rows <- sample(1:n, .66*n) x.train <- x[train_rows, ] x.test <- x[-train_rows, ] y.train <- y[train_rows] y....
83 sym R (3398 sym/13 pcs)
Final Exam Application of Financial Software Package
Final Exam 112035142 "Question1" ## [1] "Question1" library(MASS) data("Boston") Boston$crim_above_median <- ifelse(Boston$crim > median(Boston$crim), 1, 0) set.seed(123) library(caTools) split <- sample.split(Boston$crim_above_median, SplitRatio = 0.7) train <- subset(Boston, split == TRUE) test <- subset(Boston, split == FALSE) logistic_m...
84 sym R (11651 sym/56 pcs) 2 img
Investment Portfolio Analysis Final part2
Investment Portfolio Analysis Final Exam # Load necessary libraries library(tidyquant) ## Loading required package: lubridate ## ## Attaching package: 'lubridate' ## The following objects are masked from 'package:base': ## ## date, intersect, setdiff, union ## Loading required package: PerformanceAnalytics ## Loading required package: xts...
76 sym R (9078 sym/30 pcs)
In class: Factor
R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within...
639 sym R (43552 sym/42 pcs) 2 img
HW5
R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within...
603 sym R (4783 sym/7 pcs) 1 img
In class 4
R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within...
641 sym R (11659 sym/41 pcs) 5 img
In class exercise 3
R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com. When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within...
635 sym R (11738 sym/39 pcs) 1 img