Search This Blog

Wednesday, February 20, 2019

Simple linear regression with Python and R: Getting started

Linear modeling in R
Development of a linear model in R using physical property values of rubber samples. Explore the use of R for linear modeling in a detailed document.
Python and R are open-source programming languages. There is a large community of scientific software developers using Python and its NumPy and SciPy libraries. While Python is a general-purpose language, R programming mainly has its focus on statistical and predictive analysis. Both languages are currently popular choices in designing algorithms for big data problems and machine learning projects, but also are employed by researchers in diverse fields whenever the need arises for data fitting, complex calculations, simulations and modeling.

The evaluation of the the relationship between two variables is a frequently occurring task; for example, in calibrating measurement instruments and modeling experimental data. Here is a Getting Started document:  Simple linear regression with Python and R: three ways to begin with. Therein, linear modeling in Python and R is demonstrated and compared. You will learn how

  • to import CSV-formated data in Python and R ,
  • to use NumPy arrays in SLR computation,
  • to derive regression and correlation coefficients with SciPy's stats.linregress() function,
  • to use R's data.frame container with the lm() function to fit a linear model presenting your data.


Generation of scatter diagram in R
R instruction resulting into a scatter diagram for the rubber-sample data used in the linear model development
  
Keywords: linear regression, Python, R, statistical description, data analysis, machine learning.


No comments:

Post a Comment