Copula Example

Trying an introduction to copulas exercise, from (R-excerises), using the dataset (https://www.kaggle.com/datasets/gtouzin/samplestocksreturn) Exercise 1 We’ll start by fitting the margin. First, do a histogram of both Apple and Microsoft returns to see the shape of both distributions. returns <- read.csv("returns_00_17.csv") hist(returns$Apple) hist(returns$Microsoft) Exercise 2 Both distributions seems symmetric and have a domain which contain positive and negative values. Knowing those facts, use the fitdist() function to see how the normal, logistic and Cauchy distribution fit the Apple returns dataset. [Read More]

Coursera Guided Project - Predicting Diabetes

Most people have better things to do on a Saturday night after the kids are asleep. Well, this is my idea of a fun evening… Signing up for the guided project in predicting diabetes by using random forests. Here we go… Course Objectives In this course, we are going to focus on four learning objectives: Complete a random Training and Test set from one Data source using both an R function and using Base R. [Read More]

Datacamp's tidyverse course using gapminder dataset

Datacamp’s Tidyverse course using Gapminder dataset library(gapminder) library(dplyr) ## Warning: package 'dplyr' was built under R version 4.2.3 ## ## 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 head(gapminder) ## # A tibble: 6 × 6 ## country continent year lifeExp pop gdpPercap ## <fct> <fct> <int> <dbl> <int> <dbl> ## 1 Afghanistan Asia 1952 28. [Read More]
R 

Google Data Analytics Certificate

I’ve finally completed the Coursera Google Data Analytics Certificate. I think the course is great for beginners in data analytics. For me it was a great refresher on SQL and R but the other sections were not all that useful. The course did motivate me to learn R (again) and this blog site is probably a result of that. I think the course could use more on statistical thinking and spending more time on probability since data analysts could really use that in their work. [Read More]

Running Shiny R within blogdown

I just learned that I could embed the R Shiny app into blogdown from this post. So here’s an attempt at that.

R  R Shiny 

Quarto

Weave text and code and render into many outputs

Checking out Quarto today. It looks like a more comprehensive tool than R Markdown though it does a lot of similar things like being able to write text and include code cells (like Jupyter), but then also able to render the output into many formats (pdf, html, word, etc) using Pandoc. I guess that makes sense since it’s published by the same folks behind R Markdown and R Studio: [Read More]

R blogdown/pagedown and Github

Not as easy as I thought

It’s taken all day to get blogdown to sync with Github. I already had a repo set up at https://tedtwong.github.io/ and I had set up a blogdown folder in R Studio, let’s call it: R/blogdown. I wasn’t too familiar with how to set up git to sync the R/blogdown/public folder with https://tedtwong.github.io/ repo so that I can version control blogdown files and host the files on Github at the same time. [Read More]
R  blogdown  Github