Principal component analysis (PCA) is a mathematical algorithm that reduces the dimensionality of the data while retaining most of the variation in the data set. It accomplishes this reduction by identifying directions, called principal components, along which the variation in the data is maximum.

Below are the list of steps we will be following throughout the tutorial.

  • Normalize data
  • Know how to select number of components
  • Perform Principal component analysis (PCA)
  • Compute the correlations between the original data and each principal component
  • Explain the components observed
  • Scatter plot all the data on PC0 vs PC1 or PC1 vs PC2
  • Scatter…

Power curves are line plots that show how the change in variables, such as effect size and sample size, impact the power of the statistical test.

For this tutorial, we will be generating power and interpreting power curves.

In this assignment, we will use the pwr package in R.

## -- Attaching packages -------------------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.0 v purrr 0.3.3
## v tibble 2.1.3 v dplyr 0.8.4
## v tidyr 1.0.2 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.5.0

Let’s understand, What is POWER ?

The power of a hypothesis test is the probability that the test correctly rejects the null hypothesis. The power…

Calculate and output for the confidence interval for the Odds Ratioand Relative Risk.


For simplicity, I have assigned exposure and outcome groups to a,b,c and d variables inside the function.

with(,table(group,migraine)) ->

a <-[1,2]
b <-[1,1]
c <-[2,2]
d <-[2,1]

Steps to calculate Confidence Interval for Odds Ratio

  • Calculate Odds Ratio (a*d)/(b*c)
  • Calculate Point Estimate (Log of Odds Ratio so that the value looks normal)
  • Find Margin Error for 95% confidence interval 1.96 * sqrt((1/a) + (1/b) + (1/c)+ (1/d))
  • Apply +- and Exponentiate value
  • Round CI’s Upper and lower boundary

Steps to…


Entities and rules

  • Trader Account: cash balance
  • Publicly traded companies: Identified by ticker symbol (IBM, AAPL, TSLA, GE, NKE, ZM, AMZN, GM, T). Use at least 10.
  • Stock position: number of stock shares of a Public Company in a Trader Account.
  • Withdrawals and deposits: money in and into Trader Account without changing stock positions.
  • Stop order: Sell or Buy, ticker symbol, number of shares, price
  • Market order: Sell or Buy, ticker symbol, number of share.
  • Transactions: A transaction occurs when a market order is placed and there is stop order for the same company of the opposite buy/sell category.


  1. Define the place_order function…

Design a binary classifier that uses the cognitive task performance data to tell whether the person is in age category 1: 15–65 yo or category 2: all other ages.

Cinni Patel

Data Scientist — Generalist | Big data Enthusiast | Student at St Thomas Uni

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store