<jupyter_start><jupyter_text>Calculate Correlations from paperIn this notebook all correlations from the paper are calculated and it is explained where the data comes from.<jupyter_code># Import dependencies
import pandas as pd
import numpy as np
from scipy.stats import spearmanr<jupyter_output><empty_output><jupyter_text>The file `userstudy_including_survey.csv` contains data of the games played during the user study. In addition to that the survey data is already joined to the data extracted from the vidoes.Furthermore, the file also contains information wheter the player landed in a hotspot or not. This was analyzed in a separate analysis step.Because most correlations of the paper are calculated for beginner Fortnite players, we first load the data from the user study.<jupyter_code># Load the data
df = pd.read_csv("userstudy_including_survey.csv")<jupyter_output><empty_output><jupyter_text>Correlations in the paper are calculated using Spearman's rank correlation coefficient. The degree of freedom (DF) for the spearman coefficient is calculated by the sample size - 2.<jupyter_code>DF = len(df) - 2
print("DF=" + str(DF))<jupyter_output>DF=85<jupyter_text>This means that for all correlations for beginner Fortnite player, the DF is 85. Correlations for H1In the following, we calculate the correlations for **H1**, which is __Satisfaction and enjoyment are correlated and are influenced by the player's success in the game__<jupyter_code># Correlation between Satisfaction and Enjoyment
spearmanr(df["Satisfaction"], df["Enjoyment"], nan_policy='omit')
# Correlation between Satisfaction and duration of the game
spearmanr(df["Satisfaction"], df["playtime_seconds"], nan_policy='omit')
# Correlation between Satisfaction and place
spearmanr(df["Satisfaction"], df["place"], nan_policy='omit')
# Correlation between Satisfaction and kills
spearmanr(df["Satisfaction"], df["kills"], nan_policy='omit')<jupyter_output><empty_output><jupyter_text>Correlations for H3bIn the following, we calculate the correlations for **H3b**, which is __The enjoyment of Fortnite beginners is in-fluenced by the chosen landing spot__.Therefore, we analyzed if the movement traces of the individual games started in a landing, activity, or killing hot spot and added the results of this analysis as columns `hotspotlanding`, `activityhotspot` and `Killhotspotlanding`.<jupyter_code># Correlation between landing on a landing hot spot and enjoyment
spearmanr(df["hotspotlanding"], df["Enjoyment"], nan_policy='omit')
# Correlation between landing in activity hot spot and the place
spearmanr(df["activityhotspot"], df["place"], nan_policy='omit')
# Correlation between landing in activity hot spot and the playtime
spearmanr(df["activityhotspot"], df["playtime_seconds"], nan_policy='omit')<jupyter_output><empty_output><jupyter_text>Corelations for H4In the following, we calculate the correlations for **H4**, which is __The amount of time playing other games influences the success when starting to play Fortnite__.<jupyter_code># Correlation between landing in a landing hot spot and duration of watched fortnite streams
spearmanr(df["hotspotlanding"], df["watchedHours"], nan_policy='omit')<jupyter_output><empty_output><jupyter_text>Furthermore, we argue for H4 that achieving a good place and the number of kills are correlated. For analyzing this statement, we need the data of all valid games, which can be found in the file `all_valid_games.csv`<jupyter_code>df_all = pd.read_csv("all_valid_games.csv")
spearmanr(df_all["kills"], df_all["place"], nan_policy='omit')
# The DF for this values correlation is now of course changed.
print("New DF: " + str(len(df_all) - 2))<jupyter_output>New DF: 811
{'fraction_non_alphanumeric': 0.08094981111710739, 'fraction_numerical': 0.0045871559633027525, 'mean_word_length': 7.165198237885463, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '587631', 'license': 'MIT', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1002, 'n_words': 414, 'path': 'Data/Analysis/DataAnalysis.ipynb', 'repo_name': 'phylib/FortniteVideoAnalysis', 'size': '3706'}