Question: I am working on a research-based assignment where I suppose to build a 3-class (bad, medium, good) classification using SVM. The dataset provided is imbalanced. The train:test splitting ratio is 75:25 with stratified method.

**First Model** - 
I did not oversample the data

**Second Model** - 
I oversample minority class using `RandomOverSampler()` in the the train set

**Third Model** - 
I oversample minority class using `RandomOverSampler()` in the original dataset, then only i split into train and test set.

Based on all 3 models' result, which model should be chosen (even if there is room for improvement for both 3 models) in terms of logicalness, correctness and also why?

[![3 classification model result evaluation](https://i.stack.imgur.com/IizkF.png)](https://i.stack.imgur.com/IizkF.png)

Answer: 
I'm going to construe the question as meaning: What is the t-statistic and what is its probability distribution?

You have

\begin{align}
Y\_i = {} & \beta\_0 +\beta\_1 x\_i + \varepsilon\_i \quad \text{for } i=1,\ldots,n \\[10pt]
& \varepsilon\_1,\ldots,\varepsilon\_n \sim \operatorname{iid} \operatorname N(0,\sigma^2). \\[10pt]
\widehat\beta\_1 = {} & \frac{\sum\_{i=1}^n (Y\_i-\overline Y)(x\_i-\overline x)}{\sum\_{i=1}^n (x\_i - \overline x)^2} \\[10pt]
& \text{where } \overline Y = (Y\_1+\cdots+Y\_n)/n, \\
& \text{ and } \overline x = (x\_1 + \cdots + x\_n)/n. \\[10pt]
\text{and } \overline Y = {} & \widehat\beta\_0 + \widehat\beta\_1 \overline x. \quad (\text{This defines } \widehat\beta\_0.) \\[10pt]
\widehat{\varepsilon\,}\_i = {} & Y\_i -\left( \widehat\beta\_0 + \widehat\beta\_1 x\_i \right).
\end{align}
Then

* $\widehat\beta\_1 \sim \operatorname N\left( \beta\_1, \dfrac{\sigma^2}{\sum\_{i=1}^n (x\_i - \overline x)^2} \right)$
* $\dfrac{\widehat{\varepsilon\,}\_1^2 + \cdots + \widehat{\varepsilon\,}\_n^2}{\sigma^2} \sim \chi^2\_{n-2}.$
* $\widehat\beta\_1$ and $\widehat\sigma^2 = \dfrac{\widehat{\varepsilon\,}\_1^2 + \cdots + \widehat{\varepsilon\,}\_n^2}{n-2}$ are independent.

From these it follows that
$$
\frac{\widehat\beta\_1 - \beta\_1}{\widehat\sigma/\sqrt{n-2}} \sim t\_{n-2}.
$$
Therefore
$$
\widehat\beta\_1 \pm A \frac{\widehat\sigma}{\sqrt n}
$$
are the endpoints of a confidence interval for $\beta\_1,$ where $A$ is a suitable percentage point of the $t\_{n-2}$ distribution.

Here I have not included proofs of the points following the three typographical bullets above. Possibly proofs of those have been posted here before.
That answer by [Michael Hardy](https://stats.stackexchange.com/users/5176/michael-hardy) gives you the formulae for manual calculation for simple linear regression. Since you have implemented your model in `R` the easiest thing would be just to generate the outputs using standard commands in that program:

```
#Fit a linear regression model
#Substitute the actual names of your data frame and variables
MODEL <- lm(y ~ x1 + ... + xm, data = DATA);

#Print structure of model
str(MODEL);

#Print summary output
summary(MODEL);

#Print ANOVA table
anova(MODEL);

#Generate studentised residuals
RESID <- resid(MODEL);

```

The `summary` table in the `R` output contains the coefficient estimates table, which includes the t-statistics and associated p-values for each of the terms in the model.