drndr/statcodesearch huggingface dataset:
File: Model.R

Comment: Compute probabilities using MNL model
Category: Statistical Modeling
Code:
P[['choice']] = apollo_mnl(mnl_settings1, functionality) P[["indic_cost_tap"]] = apollo_mnl(mnl_settings2, functionality) P[["indic_na1"]] = apollo_mnl(mnl_settings3, functionality) P[["indic_na2"]] = apollo_mnl(mnl_settings4, functionality) P[["indic_na3"]] = apollo_mnl(mnl_settings5, functionality) P[["indic_cost_bottle"]] = apollo_ol(ol_settings5, functionality) P[["indic_bill"]]= apollo_normalDensity(normalDensity_settings1,functionality) P[["indic_qual"]] = apollo_ol(ol_settingsB1, functionality) P[["indic_qual_f"]] = apollo_ol(ol_settingsB3, functionality) P = apollo_combineModels(P, apollo_inputs, functionality)
File: Apriori_group_differences.R

Comment: d) Ftest (Stephan Gries 2013, p. 218) [only for normally distributed variables!] use var.test() Output interpretation: 1) Is p > .05?;; 2) Does the CI include 1?
Category: Statistical Test
Code:
F.lextale <- var.test(pp.explicit.incidental$lextale~pp.explicit.incidental$learningtype);; F.lextale

Comment: c) Wilcoxon ranksum test ( MannWhitney U test) [Nonparametric alternative if normality is violated, or if you have ordinal data] Continuous variables: ratioscaled lextale
Category: Statistical Test
Code:
wilcox.lextale <- wilcox.test(lextale~learningtype, data=pp.explicit.incidental, paired=FALSE);; wilcox.lextale

Comment: Selfrated variables: ordinal proficiency_overall
Category: Data Variable
Code:
wilcox.proficiency_overall <- wilcox.test(proficiency_overall~learningtype, data=pp.explicit.incidental, paired=FALSE);; wilcox.proficiency_overall

Comment: Effect size (approximate) for Wilcoxon ranksum test Write the function (from Field, Miles & Fiels 2012, p.665)
Category: Statistical Modeling
Code:
rWilcox <- function(wilcoxModel, N){ z <- qnorm(wilcoxModel$p.value/2) r <- z/sqrt(N) cat(wilcoxModel$data.name, "Effect size, r = ", r) }
File: script_for_the_analysis_of_game_data.R

Comment: create new variable for the IRV intraindividual response variability
Category: Data Variable
Code:
data$irv <- irv( dplyr::select( data, belonging, control, meaningful_existence, self_esteem ), na.rm = TRUE, split = FALSE)
File: clustering_syn_types.R

Comment: display the correlations as a histogram and heatmap
Category: Visualization
Code:
cor_matrix_half <- cor_matrix[upper.tri(cor_matrix)] mean(cor_matrix_half) sd(cor_matrix_half) hist(as.vector(cor_matrix_half), breaks=24, cex.axis=2) # Note: Novich et al. suppressed correlations of r<.4 in their visualisation heatmap(x = cor_matrix, symm = TRUE)

Comment: Create stringent dataset Exclude People with Strange Response Patterns These are identified as subclusters in the inclusive dendogram that group together
Category: Data Variable
Code:
inclusive_data$weird_responses = inclusive_data$body_postures_shape + inclusive_data$punctuation_shape + inclusive_data$letter_shape + inclusive_data$number_shape + inclusive_data$people_name_shape + inclusive_data$english_word_shape + inclusive_data$foreign_word_shape + inclusive_data$tastes_taste + inclusive_data$smells_smell + inclusive_data$noises_noise + inclusive_data$music_music + inclusive_data$colour_colour + inclusive_data$shapes_shape + inclusive_data$smells_taste + inclusive_data$tastes_smell + inclusive_data$voices_noise + inclusive_data$voices_music + inclusive_data$noises_music + inclusive_data$music_noise hist(inclusive_data$weird_responses) table(inclusive_data$weird_responses)

Comment: gives the prevalence of each cluster of data
Category: Data Variable
Code:
colMeans(short_data) N_types <- matrix(apply(short_data[,1:i], 1, sum, na.rm=TRUE)) stringent_N_clusters <- cbind(stringent_N_clusters,N_types) }
File: 01_addlagvars.R

Comment: create a continuoius time metric (seconds since midnight of day0)
Category: Data Variable
Code:
dat$sec_midnight.day0 <- dat$start.secmidnight + dat$day * 86400

Comment: create a variable indicating, if the current observation is the first observation of the day ("morning") this variable is 1, if the current observation was obtained on a different day than the previous observation
Category: Data Variable
Code:
dat[!is.na(dat$lagday) & dat$day!=dat$lagday, "morning"] <- 1 dat[!is.na(dat$lagday) & dat$day==dat$lagday, "morning"] <- 0
File: timestamp_correction.R

Comment: create continuous time variable in hours and seconds
Category: Data Variable
Code:
data$time_to_hours = lubridate::hour(data$timestamp.corrected) + lubridate::minute(data$timestamp.corrected)/60 + lubridate::second(data$timestamp.corrected)/3600 data$time_to_sec = data$time_to_hours*60*60 return(data) }
File: my_ggplot_themes.R

Comment: set font size for facet labels
Category: Visualization
Code:
strip.text.x = element_text(size = font_size_facets_x), strip.text.y = element_text(size = font_size_facets_y), strip.text.x = element_text(size = font_size_facets_x), strip.text.y = element_text(size = font_size_facets_y),