drndr/statcodesearch huggingface dataset:
File: educationestimatecentralitydefaults.R

Comment: function to create data summaries in figures
Category: Visualization
Code:
data_summary <- function(x) { m <- mean(x) ymin <- m-ci(x) ymax <- m+ci(x) return(c(y=m,ymin=ymin,ymax=ymax)) }
File: SSK_Cleaned_copy.R

Comment: to get numbers for confidence intervals click on item in global environment and expand plot 95% credible intervals
Category: Visualization
Code:
x<-plot(me, plot = FALSE)[[1]] + scale_color_grey() + scale_fill_grey() p<-x+ylim(0,1)+ theme(panel.grid.major = element_line(colour="gray"), panel.grid.minor = element_blank(), panel.background = element_blank(), axis.line = element_blank(),panel.grid.major.x = element_blank())+xlab("")+ylab("") p
File: analysis.R

Comment:  1  Never, 2  I tried it but don't do it systematically, 3  I do it when it feels convenient, 4  I do it for most research projects/studies, 5  I do it for every research project/study.  Make dataframe 'Wish' with intentions to engage in open science practices 
Category: Data Variable
Code:
wish = data[, 17:25] wish_complete = wish[,-9] # remove missing data wish = apply(wish, 2, as.numeric) wish = as.data.frame(unlist(wish)) colnames(wish) = c("preregister", "sharedatas", "sharecode", "openaccess", "preprint", "openpeer", "opensw", "replicate", "other") wish = t(wish) rowMeans(wish, na.rm = T) # mean apply(wish, 1, sd, na.rm = T) # standard deviation
File: Cross-paradigm.R

Comment: generates 95% confidence intervals for each beta coefficient
Category: Statistical Test
Code:
m.stakes_decision.CI <- round(confint(m.stakes_decision, parm = "beta_"), 3)
File: 07_analysis_rheology.R

Comment: 2.3 Loss tangents   We draw a diagram of loss tangents with logarithmic scale on the xaxis
Category: Visualization
Code:
plot(graphData$Freq[graphData$site == "wreck"], graphData$tan[graphData$site == "wreck"], log = "x", axes = FALSE, xlab = "", ylab = "", type = "b", pch = PCH, col = col_wreck, xlim = c(0.01, 100), ylim = c(0, 15)) par(new = TRUE, ps = PS, mar = MAR) plot(graphData$Freq[graphData$site == "beach"], graphData$tan[graphData$site == "beach"], type = "b", log = "x", xlab = expression("Frequency [rad s"^-1 *"]"), ylab = expression(paste("tan ", delta)), pch = PCH, col = col_beach, axes = FALSE, xlim = c(0.01, 100), ylim = c(0, 15)) axis(1, at = c(0, 0.1, 1, 10, 100, 1000), labels = c(0, 0.1, 1, 10, 100, 100)) axis(2, at = c(-1 , 0, 3, 6, 9, 12, 15)) text(x = 0.01, y = 15, label = expression(bold("c"))) abline(1, 0)
File: REL_corr_obs_descr.R

Comment: estimate mean average difference between observed and corrected values   check for sign reversals
Category: Statistical Modeling
Code:
dat_analysis[sign(MA_ES_self_corr) == sign(MA_ES_self_obs), .N] # 46 (no sign rev)
File: 02_measures.R

Comment: Step 3: Fit varyingintercept ESEM model
Category: Statistical Modeling
Code:
esem_anti_fit_alt1F <- cfa(esem_anti_model_alt1F, esem_anti_data_alt, group = "country_iso", estimator = "MLM", group.equal = "loadings")
File: R Code First Year Paper Cas Goos Analysis.R

Comment: performing the chisquared comparisons across all the possible pairs
Category: Statistical Test
Code:
pairwise.table(chi_squared_paired_comparison_1, rownames(hypotheses_per_research_area), p.adjust.method="none") pairwise.table(chi_squared_paired_comparison_2, rownames(hypotheses_per_research_area), p.adjust.method="none")

Comment: chi squared test of criteria met by association type
Category: Statistical Test
Code:
f_statistic <- chisq.test(data_hypotheses_long$association_type, data_hypotheses_long$reporting_criteria_met) f_statistic
File: twitter_analyze.R

Comment: Hastags   wordcloud of most common hashtags
Category: Visualization
Code:
frequenthashes <- hashtable[hashtable>floor(quantile(hashtable,.999))] hashvec <- unlist(lapply(frequenthashes,function(x) rep(names(x),x))) stretched <- log10(frequenthashes-min(frequenthashes)+1)/max(log10(frequenthashes-min(frequenthashes)+1)) cols <- rgb(1- stretched,0,0) png("hashcloud.png",width = 12,heigh=12,units = "cm",res=300) wordcloud(names(frequenthashes),frequenthashes,random.order = F,colors=cols) dev.off()
File: Acloserlookatfixed-effectsregressioninsem_supplementarymaterials.R

Comment: Fit the model using unweighted least square (ULS)
Category: Statistical Modeling
Code:
m1.fit <- sem( m1, sample.cov = S, sample.nobs = 200, estimator = "ULS")
File: 3H_IRT_helper.R

Comment: Remove items that do not occur in the country
Category: Data Variable
Code:
items <- items[items$item %in% colnames(x_country), ]
File: Everyday_Trust_Rcode.R

Comment: multilevel model (repeated measures) correlation using package rmcorr:
Category: Statistical Modeling
Code:
td_corr <- rmcorr(subject, trust, distrust, td) td_corr
File: R Script for Field & Wilcox (2017).R

Comment: Robust growth model MLR estimator
Category: Statistical Modeling
Code:
rctBoot <- growth(rctModel, data=rctWide, se = "bootstrap") summary(rctBoot) rctMLR <- growth(rctModel, data=rctWide, estimator = "MLR") summary(rctMLR)
File: Ex2_BasicAnalysis_Answers.R

Comment: create a scatterplot of sleep quality and insomnia scores (FIRST). Add appropriate labels
Category: Visualization
Code:
plot(Sleep_and_COVID19$PSQI_global, Sleep_and_COVID19$FIRST, main = "Main title", xlab = "X axis title", ylab = "Y axis title", frame = FALSE)

Comment: 4) Ttest    Examine whether there is a significant difference in sleep quality in those who may have symptoms or been diagnosed with COVID
Category: Statistical Test
Code:
t.test(PSQI_global ~ SymptomsOrPositive, data = Sleep_and_COVID19)

Comment: Examine whether there is a significant difference in mean sleep difficulty scores in those who undertake shiftwork
Category: Statistical Test
Code:
t.test(PSQI_global ~ ShiftWork, data = Sleep_and_COVID19) ?t.test

Comment:   6) Regression Analysis    Using multiple regression analysis, examine the influence of the age, hours worked, physical health, coffee drank  alertness and insomnia proneness on sleep quality 
Category: Statistical Modeling
Code:
model1 <- lm(PSQI_global ~ Age + WorkHour + Health + CoffeeToday + StanfordSleepinessScale + FIRST,  data = Sleep_and_COVID19) summary(model1)
File: CSEP_DataScienceExPhys_DataGen_Akerman.R

Comment: Draw samples setting heart_rate_traj above as mean with appropriate constant variance (10 beats/min)
Category: Statistical Modeling
Code:
heart_rate <- rnorm(n = length(heart_rate_traj), mean = heart_rate_traj, sd = 10)
File: Aesthetic-Fidelity-Effect-Statistical Analyses.r

Comment: Computing pvalues based on the Fdistribution
Category: Statistical Test
Code:
p_durable <- pf(q=Femp_durable, df1=Df_aest_durable, df2=Df_residual, lower.tail = F) p_nond <- pf(q=Femp_nond, df1=Df_aest_nond, df2=Df_residual, lower.tail = F)
File: Murrayetal_SurfaceR_Code.R

Comment: Logistic Regression Model  Creating null model and a logistic regression model based on all variables
Category: Statistical Modeling
Code:
lr.null <- glm(Treatment ~ 1, data = dat2, family = binomial(link="logit")) lrm <- glm(Treatment ~ Sq + Ssk + Sku + Sp + Sv + Sz + Sa,data = dat2, family = binomial(link="logit")) summary(lrm)
File: analysis_disclosure.r

Comment: Filter and select variables of interest
Category: Data Variable
Code:
d <- d_2011 %>% subset(sns == 1) %>% # indicated to use social media subset(!is.na(beh_disclose_soc)) %>% select(id, country, year, gender, age, cons_record, cons_zweck, cons_target, contains("soc"), v143:v156, # beh_setting, int_home, int_work, sns, nth_arg) %>% mutate(cons_mean = (cons_record + cons_zweck + cons_target)/3, cons_mean_bin = ifelse(cons_mean > median(cons_mean, na.rm = T), 1, ifelse(is.na(cons_mean), NA, 0))) %>% mutate(age_group = ifelse(age <= 32, "younger than 32 years", "older than 32 years"))

Comment: Confirmatory factor analyses  CFA for privacy concerns (tauequivalent)
Category: Statistical Modeling
Code:
cfa.model <- " priv_con =~ 1*cons_record + 1*cons_zweck + 1*cons_target " fit <- cfa(cfa.model, d_2011) summary(fit, std = T, fit = T) reliability(fit)

Comment: Estimate models across all specifications  Customized model functions to include random country effect
Category: Statistical Modeling
Code:
linear <- function(formula, data) { pb$tick() # set tick for progress bar lmer(paste(formula, "+ (1|country)"), data = data) }

Comment: Decomposing variance  Estimate multilevel model (without predictors)
Category: Statistical Modeling
Code:
m_lin <- lmer(stdcoef ~ 1 + (1|x) + (1|controls) + (1|subsets)  + (1|x:controls) + (1|x:subsets) + (1|subsets:controls), data = results) summary(m_lin)
File: helpers.R

Comment: run polynomial regresion as a OLS linear model
Category: Statistical Modeling
Code:
f <- paste0(DV, " ~ ", paste("1", IV1, IV2, IV12, IV_IA, IV22, sep=" + "), controlvariables) lm.full <- lm(f, data=df, na.action=na.exclude)
File: codes_reanalysis.R

Comment:  Matrix of phenotypic change trajectories X and Z,  interlineage correlation matrix C, and intertrait crossproduct matrix A,  as well as the number of lineages n ( 13)  and dimensionality of the vectors p ( 76) 
Category: Data Variable
Code:
X <- f.mean.diff(data.sc, fishID) Z <- X / sqrt(diag(tcrossprod(X))) C <- tcrossprod(Z) A <- crossprod(Z) n <- nrow(Z) p <- ncol(Z) - 4 # -4 accounting for the loss of d.f. from Procrustes alignment

Comment:  Histograms comparing dissimilarity between the original and  bootstrap replicates between "Moo" and "Pac" (largest and smallest dispersion)  This shows that the heteroscedasticity is real (not due to visual distortion) 
Category: Visualization
Code:
hist(acos(Z[10, ] %*% Zb[10, , ]), breaks = seq(0, pi / 2, 0.1), col = "#FF000080", main = "Pac (red) versus Moo (blue)", xlab = "Angle between original and bootstrap vectors (radian)") hist(acos(Z[7, ] %*% Zb[7, , ]), add = TRUE, breaks = seq(0, pi / 2, 0.1), col = "#0000FF80")
File: dump_csv.R

Comment:  Use kNNdistplot(d.cor.umap, k  3) to determine the value for eps 
Category: Visualization
Code:
d.cor.dbscan <- dbscan(d.cor.umap, minPts = 3, eps = 1.8) data.table.large.cluster <- data.table[,d.cor.dbscan$cluster == 1] large.cluster.cor.metric <- as.dist(acos(cor(data.table.large.cluster))) large.umap <- umap( large.cluster.cor.metric, min_dist = 1, n_neighbors = 3 ) large.dbscan <- dbscan(large.umap, minPts = 3, eps = 1) large.cols <- rainbow(length(unique(large.dbscan$cluster)), start = 2/6) write.csv( d.cor.umap, 'd_acos_cor_fixed.csv', row.names = F ) write.csv( d.cor.dbscan$cluster, 'dbscan_clustering_fixed.csv' ) write.csv( large.umap, 'd_acos_cor_fixed_large_cluster.csv', row.names = F ) write.csv( large.dbscan$cluster, 'dbscan_clustering_of_large_cluster_fixed.csv' )
File: beliefhelp15-220615.R

Comment:  Chisquare test: Difference in preference based on outcome, by condition
Category: Statistical Test
Code:
chisq.test(matrix(c(19,5,5,17), ncol = 2, byrow = T)) oddsratio.wald.outcome <- oddsratio.wald(matrix(c(19,5,5,17), ncol = 2, byrow = T))$measure[2] # Note: I reorganized the matrix so that r is of the same sign as that of Experiment 2 esc_2x2( grp1yes = 19, grp1no = 5, grp2yes = 5, grp2no = 17, es.type = "or" ) # this confirms Wald's odds ratio

Comment:  Two sample ttest: Difference in proportionate looking based on outcome, by condition
Category: Statistical Test
Code:
twosamplet.outcome <- t.test(pPositiveO ~ Condition, data = bh2zoom, alternative = "two.sided") twosampled.outcome <- cohen.d(pPositiveO ~ Condition, data = bh2zoom)$estimate
File: assessQualityOfcaptWKL.R

Comment:  Assess how well model captured PWLs ' ' This function calculates several indicators that help to assess how well the model captured captWKLs beyond simple layer structure. ' It get's called by the overarching evaluation script `evaluate_main.R` ' ' So, for each WKL the function computes ' ' * correlation factors for likelihood/distribution/sensitvity versus proportion of unstable grid points ' * the maximum proportion of unstable grid points during the lifetime of the WKL ' * the temporal lag between first forecaster concern (> avy problem) and first time that grid points are unstable in that layer '      different timing instances possible: first time (i) at least one grid point unstable, (ii) the majority of grid points is unstable, (iii) more than 50 % of max proportion unstable ' * the temporal lag between latest forecaster concern (> last day of avy problem) and last time that grid points are unstable in that layer '      need to find rules for becoming dormant and waking up again versus becoming inactive ' ' @param VData object;; don't include both primary/secondary and tertiary gtype_ranks! ' ' @export 
Category: Statistical Modeling
Code:
assessQualityOfcaptWKL <- function(VData, band, stabilityindex = "p_unstable") { gtype_rank <- unique(VData$vframe$gtype_rank) if (any(c("primary", "secondary") %in% gtype_rank) & "tertiary" %in% gtype_rank) stop("You can only provide either primary and/or secondary, or tertiary gtype_ranks in your VData object to this function!") possible_ranks <- c("tertiary", "secondary", "primary") gtype_rank <- possible_ranks[possible_ranks %in% gtype_rank][1] nrow_max <- length(VData$wkl$wkl_uuid) OUTnames <- c( "wkl_uuid", "wkl_iscrust", "wkldate", "wkltag", "nPDays", "nPDays_anyunstable", "nPDays_median", "nPDays_halfofmax", "nPDays_20", "rho_llhd", "rho_dist", "rho_sens", "p_llhd", "p_dist", "p_sens", "pu_max", "offset_maxes", "offset_mean", "pcapt_max", "lagA_anyunstable", "lagA_median", "lagA_halfofmax", "lagA_20", "lagZ_anyunstable", "lagZ_median", "lagZ_halfofmax", "lagZ_20", "band", "stabilityindex", "gtype_rank" ) OUT <- matrix(nrow = max(1, nrow_max), ncol = length(OUTnames), dimnames = list(seq(max(1, nrow_max)), OUTnames)) for (i in seq_along(VData$wkl$wkl_uuid)) { wuid <- VData$wkl$wkl_uuid[i] wkldate <- as.character(as.Date(VData$wkl$datetag[i])) wkltag <- paste(format(as.Date(VData$wkl$datetag[i]), "%b %d"), substr(gtype_rank, start = 1, stop = 4)) wkl_iscrust <- as.logical(VData$wkl$iscrust[i])
File: analysis.R

Comment: Correlation of life satisfaction and depression across all measurement occasions
Category: Statistical Test
Code:
d.all %>% select(contains("fsat"), contains("depr"), id) %>% gather(key, value, -id) %>% separate(key, c("time", "variable")) %>% spread(variable, value) %>% select(depr, fsat) %>% zero_order_corr(print = T, digits = 3) %>% select(`1`) %>% slice(2)
File: Pandemic_Cohorts_vs_Pre_Pandemic_Cohorts.R

Comment: check if latent covariances are equal across groups
Category: Statistical Modeling
Code:
est_svc <- cfa(mod_s,quop_use, estimator = "MLR", missing = "FIML", group = "year", group.equal = c("loadings","intercepts","residuals", "lv.variances","lv.covariances"), cluster = "class")

Comment: get factor scores from model est_svcm_sl
Category: Statistical Modeling
Code:
fs <- lavPredict(est_svcm_sl, method = "bartlett")
File: functions_1.R

Comment:   Plot for distribution of emotions   Arguments: original ddbb, type of emotion, plot title 
Category: Visualization
Code:
create.emotion.plot <- function(case_ddbb, emotion="emotion", plot_title=NULL){

Comment:   Table and plot for effect sizes   Arguments: original ddbb, plot title 
Category: Visualization
Code:
create.effectsize.tableplot <- function(case_ddbb, plot_title = NULL){
File: 2021-12-03_AnalysisCode.R

Comment: Convert average time into a ordinal variable
Category: Data Variable
Code:
Tbl2$DurSecAvg1Cat <- cut(Tbl2$DurSecAvg1, breaks = quantile(Tbl2$DurSecAvg1, c(0, 1/3, 2/3, 1)), include.lowest = T) aggregate(Tbl2$DurSecAvg1, list(Tbl2$DurSecAvg1Cat), summary) levels(Tbl2$DurSecAvg1Cat) <- c("Less", "Avg", "More")

Comment: Plotting Figure 3
Category: Visualization
Code:
png(filename = "Fig03_Demographics.png", width = 19, height = 10, units = "cm", res = 500, pointsize = 7) par(mfrow=c(2,3))

Comment: Predict node for checking differences in distributions with chisquared test
Category: Statistical Test
Code:
Tbl2$NodeRate <- predict(Engage, newdata = Tbl2, type = "node") table(Tbl2$NodeRate) (temp <- chisq.test(Tbl2$NodeRate, Tbl2$FeedbackEngage)) temp$observed round(100*prop.table(temp$observed, 1), 1) mosaic(temp$observed, shade = T) Tbl2$NodeRate <- predict(FeedTree, newdata = Tbl2, type = "node") table(Tbl2$NodeRate) (temp <- chisq.test(Tbl2$NodeRate, Tbl2$Useful_FeedbackMiddle)) temp$observed round(100*prop.table(temp$observed, 1), 1) mosaic(temp$observed, shade = T) Tbl2$NodeRate <- predict(ExTree, newdata = Tbl2, type = "node") table(Tbl2$NodeRate) (temp <- chisq.test(Tbl2$NodeRate, Tbl2$Useful_FeedbackMiddle)) temp$observed round(100*prop.table(temp$observed, 1), 1) mosaic(temp$observed, shade = T) head(Tbl2$RankTaskPerform)
File: campaign_messages.R

Comment: Convert `from_name` to factor with three levels. (Facilitates data visualization).
Category: Data Variable
Code:
Campaign_Messages$from_name <- factor(Campaign_Messages$from_name, levels = c ("Stephen Harper", "Justin Trudeau", "Tom Mulcair"))
File: visualization_code.R

Comment: change the title text to size 20 and bold
Category: Visualization
Code:
axis.title = element_text(size = 20, face = "bold"), axis.title = element_text(size = 20, face = "bold"),

Comment:  change the axis label text to size 14, bold, and black color 
Category: Visualization
Code:
axis.text.x = element_text(size = 14, face = "bold", color = "black"), axis.text.y = element_text(size = 14, face = "bold", color = "black")) + axis.text.x = element_text(size = 14, face = "bold", color = "black"), axis.text.y = element_text(size = 14, face = "bold", color = "black")) + scale_y_continuous(limits = c(0, 17), expand = c(0,0)) +
File: 00-utils.r

Comment: Identify all neighbours within 2km
Category: Data Variable
Code:
sp_nb <- spdep::dnearneigh(coords, d1 = 0, d2 = km, row.names = row.names(sp), longlat = TRUE)

Comment: take the inverse of the distances
Category: Data Variable
Code:
W <- lapply(dsts, function(x) 1 / x) W <- lapply(dsts, function(x) 1 / x)
File: read-data-Exp1.r

Comment: recode base price and overage as numeric (without $ sign)
Category: Data Variable
Code:
x$b1=as.numeric(sapply(strsplit(as.character(x$b1),"\\$"),function(y) y[2])) x$b2=as.numeric(sapply(strsplit(as.character(x$b2),"\\$"),function(y) y[2])) x$b3=as.numeric(sapply(strsplit(as.character(x$b3),"\\$"),function(y) y[2])) x$c1=as.numeric(sapply(strsplit(as.character(x$c1),"\\$"),function(y) y[2])) x$c2=as.numeric(sapply(strsplit(as.character(x$c2),"\\$"),function(y) y[2])) x$c3=as.numeric(sapply(strsplit(as.character(x$c3),"\\$"),function(y) y[2]))
File: 02_parameter_estimation.R

Comment:  create dataset with possible k values, their prior and likelihood  probabilities  likelihood is drawn from 1000 random samples from beta distibution 
Category: Statistical Modeling
Code:
df <- tibble(k = hypo_k) %>% mutate(model_vote = 0.0727^k) %>% mutate(occur = map_int(.$model_vote, ~ length(which(polls$value >= .x))), prior = prob_k) %>% mutate(like = map(.$occur,~ rbeta(trials, .x, polls_len - .x)))

Comment: visualise normalised posterior on a graph
Category: Visualization
Code:
p <- df %>% ggplot(aes(k, norm_posterior)) + geom_point() + geom_line() p + labs( title = "Probability of k exponent in the interval <0.89;; 0.99>", x = "Value o k exponent", y = "Normalised probability" ) + theme_minimal()
File: 220423_Fig04_Use_JargExpl.R

Comment: 3) CALCULATION OF ESTIMATED MARGINAL MEANS   Tests for differences in response to jargon for plot
Category: Statistical Modeling
Code:
at_jarg <- list(Jargon = c("More", "Less"), UnderN = "Easy", RecognN = "Fairly", TrvlAdv_Atten = "Cons", cut = "3|4") grid_jarg <- ref_grid(clmm_usejar, mode = "exc.prob", at = at_jarg) (emm_jarg <- emmeans(grid_jarg, specs = pairwise ~ Jargon, by = "BackgrAvTraining")) plot_jarg <- summary(emm_jarg$emmeans) cont_jarg <- summary(emm_jarg$contrasts)
File: 3DFDRPlot.R

Comment:  Gradient of FDR with respect to alpha (and its implied power) across ncp for a onesided ztest  Note that the gradient is increasing towards $\infty$ from both side at ncp  0 and alpha 0, but is equal to 0 at that point. The figure does not allow to depict it properly and it seems like as if it peaked at ncp around .5 and was decreasing towards 0.  Green corresponds to $P(H_0)  .2$, blue to $P(H_0)  .5$, and red to $P(H_0)  .8$. 
Category: Visualization
Code:
alpha <- seq( 0, 1, length.out = 500) ncp   <- seq(-5, 5, length.out = 500) FDR.2od  <- fill_gradFDR.alpha(.2, alpha, ncp, FALSE) FDR.5od  <- fill_gradFDR.alpha(.5, alpha, ncp, FALSE) FDR.8od  <- fill_gradFDR.alpha(.8, alpha, ncp, FALSE) plot_ly(x = ~alpha, y = ~ncp, z = ~FDR.5od) %>% add_surface(contours = list( y = list( show = TRUE, project = list(y = TRUE), usecolormap = FALSE, color = "blue" ), x = list( show = TRUE, project = list(x = TRUE), usecolormap = FALSE, color = "blue" ) ), opacity = .4) %>% layout(scene = list( xaxis = list( tickvals = c(0, .05, .1, .2, .5, 1) ), yaxis = list( tickvals = pretty(ncp) ), zaxis = list( tickvals = seq(0, 1, .2), title    = list(text = "FDR'") ) )) %>% add_surface(x = ~alpha, y = ~ncp, z = ~FDR.8od, opacity = .4, contours = list( y = list( show = TRUE, project = list(y = TRUE), color = "red" ), x = list( show = TRUE, project = list(x = TRUE), color = "red" ) )) %>% add_surface(x = ~alpha, y = ~ncp, z = ~FDR.2od, opacity = .4, contours = list( y = list( show = TRUE, project = list(y = TRUE), color = "green" ), x = list( show = TRUE, project = list(x = TRUE), color = "green" ) ))
File: splithalf_table_function.R

Comment: List that will include table (each element should be vector of 3):
Category: Data Variable
Code:
Table <- list( c("Network Characteristics",title,""), c("Comparing Global Characteristics",nameOrig, nameRepl) )
File: return_BF_ttests.R

Comment:  The row with "def_cond" is moved to a new column and duplicated (this is  done with reference to "cond_to_group") 
Category: Data Variable
Code:
df_tmp_2 <- full_join( df_tmp_1 %>% filter({{cond_to_compare}} != def_cond), df_tmp_1 %>% filter({{cond_to_compare}} == def_cond), by = col )
File: Meta_Analysis.R

Comment: Repeating the analyses with closeness as covariate
Category: Statistical Modeling
Code:
cor.test(data_3A$closeness_1,data_3A$closeness_2) cor.test(data_3B$closeness_1,data_3B$closeness_2) cor.test(data_3C$closeness_1,data_3C$closeness_2)
File: Skip_Backwards.R

Comment: check if the number of processed partners is smaller than the number of listed partners as saved in the counter variable
Category: Data Variable
Code:
nrow(Relationship_details) < My_EHC_survey$count_SP
File: N400.R

Comment: run anovas to check interaction between specificity and condition  LA
Category: Statistical Test
Code:
anova_N4_la_sp = summary(aov(Voltage ~ Condition *Specificity , data = mydata_n4_la)) anova_N4_la_sp
File: grid_visualize_3by3.R

Comment: Visualize grid cluststers
Category: Visualization
Code:
mgp.u<-c(2.3,0.6,0.5) if(tifit==T){ tiff(tifname,width=14,height=12.5,units="cm",res=600,compression="lzw") } par(oma=c(0,4,4,4)) layout(matrix(1:9,ncol=3,byrow=T),widths=c(1.28,1,1),heights=c(1,1,1.28)) doFloorC(n=1000,eta=1,char=char,mar1=c(gap,3.5,gap,gap),mgp1=mgp.u,xax=F,yax=T,xl="",col2=col2,seq.s=seq.s,seq.c=seq.c,contour=contour)

Comment: Create the dataset for visualizations Summarize the means (and sd for clusters)
Category: Data Variable
Code:
means.cl<-tapply(res$clust,paste(res$n,res$h,res$nu,res$eta),mean,na.rm=T) sd.cl<-tapply(res$clust,paste(res$n,res$h,res$nu,res$eta),sd,na.rm=T) means.dim<-tapply(res$explained3D,paste(res$n,res$h,res$nu,res$eta),mean,na.rm=T) means.avg<-tapply(log(res$avgdist),paste(res$n,res$h,res$nu,res$eta),mean,na.rm=T) vars<-strsplit(names(means.cl)," ")