I am trying to find the equivalent of a t-test in Python where you can insert a number, e.g.
<code>reg_model.t_test('x1=5')
</code>
<code>reg_model.t_test('x1=5')
</code>
reg_model.t_test('x1=5')
I found a comment saying this:
<code>t.test(y~x1, data=data, alternative=c("two.sided"), mu=5, conf.level=0.95, var.eq=F, paired=F),
</code>
<code>t.test(y~x1, data=data, alternative=c("two.sided"), mu=5, conf.level=0.95, var.eq=F, paired=F),
</code>
t.test(y~x1, data=data, alternative=c("two.sided"), mu=5, conf.level=0.95, var.eq=F, paired=F),
but it doesn’t take into account the other regressors.
I know I can do the calculations manually, or see the confidence intervals, e.g.
<code>reg_model <- lm(y~x1+x2+x3, data=df)
t.stat <- t.test['x1',1]-5)/t.test['x1',2]
</code>
<code>reg_model <- lm(y~x1+x2+x3, data=df)
t.stat <- t.test['x1',1]-5)/t.test['x1',2]
</code>
reg_model <- lm(y~x1+x2+x3, data=df)
t.stat <- t.test['x1',1]-5)/t.test['x1',2]
,
but was wondering if there is maybe one command that can help, like in Python.
Thank you in advance
New contributor
Valentina D. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.