MATLAB Equivalent of Linregress in Python?

8 visualizaciones (últimos 30 días)
Rudraneel Roy
Rudraneel Roy el 9 de Ag. de 2020
Comentada: Star Strider el 9 de Ag. de 2020
I have a vector and I want to find out the p-value of the data. In python, linregress(X,Y), gives one of the outputs as p-value. What is the MATLAB equivalent of the same?

Respuestas (1)

Star Strider
Star Strider el 9 de Ag. de 2020
If you have the Statisitcs and Machine Learning Toolbox, there are several options, among which are regress and fitlm. There may also be File Exchange contributions.
  2 comentarios
Rudraneel Roy
Rudraneel Roy el 9 de Ag. de 2020
Can you please elaborate further?
I have a excel sheet of data (of 30 rows and 1 column) which I import into MATLAB. I need to check for a linear trend of the data.
Let's say, it is a vector X = [10, 20, 30, 20,....]'
How do I find out the p_value (and consequently check if it is less than 0.5)?
Star Strider
Star Strider el 9 de Ag. de 2020
I was under the impression that you actually had a matrix of two vectors (or two separate vectors) that would correspond to the ‘x’ and ‘y’ arguments that the linear regression function requires. You cannot do a regression on one vector. That is just how regression works.
If you want to use the t-statistic to find out if the mean of your vector is different from zero, use the ttest function. That will give you the p-value and a number of other statistics.

Iniciar sesión para comentar.

Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by