Clear Filters
Clear Filters

Is the pvalue from an lmfit table derived from a two-sided or one-sided t-test?

7 views (last 30 days)
I am using the lmfit to do a linear regression analysis between independent variable x and its relationship with the dependent variable y. The output of this simple model looks like:
y ~ 1 + x1
After using lmfit on the data for x and y variables, a table providing the t-statistic and the associated p-value are given for variable x1.
My question is, does the p-value in this table automatically account for a two-tailed test or does the p-value need to be doubled to account for this? According to the MATHWORKS page, the pvalue for the t-statistic is for a two-sided hypothesis test, so it leads me to believe that the p-value that is reported in the table does not need to be doubled and is already taken into account in the calculation. And if that is true, if you wanted to do a one-sided hypothesis test based on this p-value, you should halve the p-value to get your answer. Could anyone verify these questions/assumptions?
Here is my source on MATHWORKS about lmfit being a two-sided hypothesis test: https://www.mathworks.com/help/stats/fitlm.html#mw_11b75ad7-ce2d-4251-9e8f-2b70dbfe4f4d
Thanks so much!

Accepted Answer

Star Strider
Star Strider on 23 May 2024
For what it’s worth, when I updated my polyparci function, I used a default two-sided t-distribution to calculate the probabilities, and used fitlm to verify my probability results. It is two-sided.
That is the only sort of verificiation I can provide.
  4 Comments
William
William on 23 May 2024 at 19:43
Thank you so much, I just saw your page for that function! Appreciate it and already testing it on my data.
Star Strider
Star Strider on 23 May 2024 at 20:34
As always, my pleasure!
It has a friend polypredci that calculates the confidence intervals on the fit, if you need to do that as well.
Please.let me know if you have any comments or concerns about any of them.

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!