Σ
SDCalc
FortgeschrittenAnleitungen·15 min

Standardabweichung in Excel & Python berechnen

Schritt-für-Schritt-Anleitungen zur Berechnung der Standardabweichung in Excel (STDEV.S, STDEV.P) und Python (numpy, pandas, statistics). Mit Codebeispielen.

Excel: Überblick

Microsoft Excel bietet integrierte Funktionen zur Berechnung sowohl der Stichproben- als auch der Populationsstandardabweichung. Diese Funktionen sind in allen modernen Excel-Versionen verfügbar.

Excel-Funktionen

FunktionTypBeschreibung
`STDEV.S()`StichprobeStichprobenstandardabweichung (teilt durch n-1)
`STDEV.P()`PopulationPopulationsstandardabweichung (teilt durch N)
`STDEV()`StichprobeÄltere Funktion, entspricht STDEV.S
`STDEVP()`PopulationÄltere Funktion, entspricht STDEV.P

Excel-Beispiele

Excel Formulas
// Data in cells A1:A10
=STDEV.S(A1:A10)     // Sample SD
=STDEV.P(A1:A10)     // Population SD

// For specific values
=STDEV.S(4, 8, 6, 5, 3)    // Returns 1.924

// Ignoring text and logical values
=STDEV.S(A1:A10)    // Ignores text
=STDEVA(A1:A10)     // Includes text as 0

Profi-Tipp

Verwenden Sie STDEV.S für die meisten praxisnahen Analysen. Nutzen Sie STDEV.P nur, wenn Sie sicher sind, dass Sie die vollständige Population haben.

Python: Überblick

Python bietet mehrere Möglichkeiten zur Berechnung der Standardabweichung. Die gängigsten Bibliotheken sind NumPy, Pandas und das integrierte statistics-Modul.

Mit NumPy

Python (NumPy)
import numpy as np

data = [4, 8, 6, 5, 3]

# Population standard deviation (default)
pop_sd = np.std(data)
print(f"Population SD: {pop_sd}")  # 1.720

# Sample standard deviation
sample_sd = np.std(data, ddof=1)
print(f"Sample SD: {sample_sd}")  # 1.924

Was ist ddof?

ddof steht für "Delta Degrees of Freedom" (Delta-Freiheitsgrade). Wenn ddof=1 gesetzt wird, teilt NumPy durch (n-1) für die Stichproben-SD. Der Standardwert ddof=0 liefert die Populations-SD.

Mit Pandas

Python (Pandas)
import pandas as pd

# Create a DataFrame
df = pd.DataFrame({'scores': [85, 90, 78, 92, 88]})

# Sample SD (default in pandas)
sample_sd = df['scores'].std()
print(f"Sample SD: {sample_sd}")

# Population SD
pop_sd = df['scores'].std(ddof=0)
print(f"Population SD: {pop_sd}")

# Multiple columns at once
df.std()  # Returns SD for all numeric columns

Schnellvergleich

WerkzeugStichproben-SDPopulations-SD
Excel`STDEV.S()``STDEV.P()`
NumPy`np.std(data, ddof=1)``np.std(data)`
Pandas`df.std()``df.std(ddof=0)`
Python statistics`stdev()``pstdev()`