wilsonzhang746

Recode variables in R

In data analysis it is often needed to set new values to a variable based on one or several conditions,…

10 months ago

Working with date values in R

R has rich resources of functions dealing with date values in data analysis. In this post, we introduce and show…

10 months ago

How to generate random numbers from various statistical distributions using R

n this post, we show how to generate random numbers into vector and matrix in R programming, from various statistical…

10 months ago

Creating a random sequence using sample() in R

It is not uncommon to generate random sequences in R programming. sample() function provides the feasibility of generating such random…

10 months ago

Estimating simple linear regression model using lm() in R

Linear regression is widely used to model the relationship between response or dependent variable and explanatory or independent variables. The…

10 months ago

Using exponential distributions in Python

The exponential distribution is modeling the probability distribution of the random time until next event occur in a Poisson event…

11 months ago

Append, insert and remove elements of lists in Python

The elements of a list can be added or removed after it has been created. To add new elements at…

11 months ago

Working with Python classes and instances

Python uses class for object-oriented programming. A class represents the general behavior or information that the programmer or data analyst…

11 months ago

Calculating partial correlations with R

When we do data analysis, random variables in the dataset are usually mutually correlated. Sometimes, we may want to measure…

11 months ago

Working with normal distributions in Python

Normal distribution is describing random variables with bell-shaped probability density functions. Normal distribution is widely used in data science because…

11 months ago