I have a table with some basic descriptive statistics, which I created in RStudio using the stargazer package. This is the code:
\begin{table}[!htbp] \centering
\caption{Deskriptive Statistiken und Stichprobenzusammensetzung}
\label{}
\begin{tabular}{@{\extracolsep{5pt}} lccccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& n & Mittelwert & Standardabweichung & Minimum & Maximum \\
\hline \\[-1.8ex]
Alter & $6,397$ & $38.44$ & $13.06$ & $18$ & $67$ \\
Arbeitsweg [in min] & $6,397$ & $26.53$ & $22.73$ & $0$ & $454$ \\
Arbeitsweg [in km] & $6,397$ & $15.25$ & $17.03$ & $0$ & $300$ \\
subj. Gesundheit & $6,397$ & $3.54$ & $0.93$ & $1$ & $5$ \\
Krankheitstage [Vorjahr] & $6,397$ & $16.37$ & $32.41$ & $1$ & $365$ \\
wöchentl. Arbeitszeit & $6,397$ & $37.71$ & $10.48$ & $0$ & $95$ \\
ISEI-Wert & $6,397$ & $47.17$ & $19.80$ & $11.56$ & $88.70$ \\
Frauen & $6,397$ & $0.59$ & $0.49$ & $0$ & $1$ \\
\hline \\[-1.8ex]
\end{tabular}
\end{table}
This the result I get (pls ignore the german labels). It looks good, but as you can see, the table caption is not centered but shifted to the left. How do I change that?
I already tried captionsetup from the caption package, cause thats what a lot of posts suggested:
\documentclass{article}
\usepackage{caption}
...
\begin{table}[!htbp] \centering
\captionsetup {justification = centering}
\caption{Deskriptive Statistiken und Stichprobenzusammensetzung}
However this didn't work and the caption is still at the same place. In fact, it didn't matter if I used centering, raggedleft, raggedright or any other argument. It didn't move at all. Did I use the package incorrectly? I'm completely new to Latex, so I'm not really sure how stuff works. I'm using overleaf btw, in case it matters
I'm really grateful for any kind of advice. Thanks in advance!

& n & $\mu$ & $\sigma$ & Min. & Max. \\or make a small, but cmopilable test file so we can see what page geometry you have. – samcarter_is_at_topanswers.xyz Mar 15 '24 at 13:13\documentclass{}? (sorry for my stupid questions, I'm a complete noob at this) – Moritary Mar 15 '24 at 13:20& n & Mittelwert & Standardabweichung & Minimum & Maximum \\with this shorter version. – samcarter_is_at_topanswers.xyz Mar 15 '24 at 13:21\usepackage[a4paper]{geometry}and now it looks good. This way I could keep the original labels, cause they are more precise statistically – Moritary Mar 15 '24 at 14:05\usepackage[a4paper]{geometry}actually increases the width (and the height) of the textblock. It's great that you have this degree of freedom in choosing a larger value of the very important parameter\textwidth. It would have been useful if you had mentioned up front that this degree of freedom was available. (It usually isn't...) – Mico Mar 15 '24 at 15:01