Comparing job satisfaction of part-time workers from two different industries I would like to compare the job satisfaction of part-time workers in the health industry and the financial industry. Should I do a t-test? How can I do this with R. Can I use stargazer to get a table for a word document?
Variables
IND

*

*12 = Financial industry (339 observations)

*17 = Health industry (678 observations)

EMP

*

*2 = Part-time

pv1 (Job satisfaction)

*

*1 = very dissatisfied


*2 = dissatisfied


*3 = neutral


*4 = satisfied


*5 = very satisfied
 A: Your question lacks all of the information needed to say whether a t test would be
appropriate. Some people (myself included) are not enthusiastic about treating Likert
data as if they were interval numerical. For example, that means believing that two Satisfied responses balance one Very dissatisfied, roughly to be equivalent of three Neutral ones when finding a 'mean'.
I would prefer treating Likert data as the ordinal scores they really are, and using a two-sample Wilcoxon (rank sum) test: to see if scores in one group tend to be greater than scores in another group.
Here are some simulated Likert data along with examples how to use t.test and wilcox.test in R:
set.seed(728)
x1 = sample(1:5, 339, rep=T, p=c(1,2,3,2,2))
table(x1)
x1
 1  2  3  4  5 
33 70 95 75 66 

quantile(x1)
  0%  25%  50%  75% 100% 
   1    2    3    4    5 

x2 = sample(1:5, 678, rep=T, p=c(1,2,2,2,3))
table(x2)
x2
  1   2   3   4   5 
 71 133 134 146 194 

quantile(x2)
  0%  25%  50%  75% 100% 
   1    2    4    5    5 

Here are 'notched' boxplots of scores for the two groups. Notches
that don't overlap tend to indicate a significant difference in location
between the two groups.
boxplot(x1,x2, notch=T, horizontal=T, col="skyblue2")


A nonparametric two-sample Wilcoxon test shows borderline significance at the $5\%$ level with its P-value $0.033.$
wilcox.test(x1, x2)

        Wilcoxon rank sum test with continuity correction

data:  x1 and x2
W = 105710, p-value = 0.03263
alternative hypothesis: true location shift is not equal to 0

To the extent that group means are appropriate measures of locations of Likert
scores of the two groups, a Welch two-sample t test also shows borderline
significance with P-value $0.044 < 0.05 = 5\%.$
t.test(x1,x2)

        Welch Two Sample t-test

data:  x1 and x2
t = -2.0207, df = 727.08, p-value = 0.04368
alternative hypothesis: 
  true difference in means is not equal to 0
95 percent confidence interval:
 -0.340228610 -0.004904133
sample estimates:
mean of x mean of y 
 3.209440  3.382006 

A: This is a case where t-tests can go horribly wrong, see for example:

*

*Liddell, T. M., & Kruschke, J. K. (2018). Analyzing ordinal data with metric models: What could possibly go wrong?. Journal of Experimental Social Psychology, 79, 328-348. (https://www.sciencedirect.com/science/article/abs/pii/S0022103117307746)

You should use an approach that respects the categorical nature of your data, for example your ignorance about whether a step up from "dissatisfied" to "neutral" means the same, in terms of satisfaction, as a step up from "satisfied" to "very satisfied".
You can do this for example using ordered probit or logit models (also called proportional odds models), either in a frequentist or Bayesian framework. Above reference advocates for the latter and provides an example in R. For a frequentist example in R, see for example: https://stats.idre.ucla.edu/r/faq/ologit-coefficients/.
Useful R functions for ordinal regression are ordinal::clm2() and MASS::polr().
You inference on the strength of evidence for a difference in satisfaction and the size of that difference can then be based on the odds ratio of the binary predictor (industry type) and its associated uncertainty (e.g., confidence or credible intervals).
Some obvious advantages over non-parametric methods like rank based tests:
The approach explicitly estimates a parameter that describes how likely it is to give a higher category or lower category rating when the group category is changed (but beware of causal interpretation given the probably observational cross-sectional data), and allows you to condition this estimate on additional variables like gender and age, if available in your dataset. You can also predict an individual probability for each person for giving a certain response.
