change trend
This commit is contained in:
parent
17a797c870
commit
85517606a0
|
|
@ -12,6 +12,7 @@ require(lmerTest)
|
|||
library(dplyr)
|
||||
library(pscl)
|
||||
require(MASS)
|
||||
library(MuMIn)
|
||||
|
||||
categorical_factors = c('has_goal', 'freelancer', 'company_null', 'email_null', 'isEmployee', 'isBountyHunter', 'isCampusExpert', 'isDeveloperProgramMember', 'isGitHubStar', 'isHireable', 'isSiteAdmin', 'location_null', 'twitterUsername_null', "other_way", "intervention")
|
||||
|
||||
|
|
@ -60,10 +61,36 @@ df$location_null = relevel(df$location_null, ref = "1")
|
|||
df$other_way = relevel(df$other_way, ref = "0")
|
||||
|
||||
df$slope_change = df$after_slope - df$before_slope
|
||||
df$slope_change = df$slope_change + abs(df$slope_change)
|
||||
df$slope_change_convert = (df$slope_change - min(df$slope_change)) / max(df$slope_change)
|
||||
|
||||
m_account_commit_slope = lm(
|
||||
formula=scale(log(slope_change+0.5))~
|
||||
formula=log(slope_change_convert+0.5)~
|
||||
scale(log(user_age+0.5)) +
|
||||
scale(log(min_tier+0.5)) +
|
||||
scale(log(max_tier+0.5)) +
|
||||
has_goal +
|
||||
scale(log(bio_length+0.5)) +
|
||||
scale(log(followers+0.5)) +
|
||||
scale(log(followings+0.5)) +
|
||||
scale(log(history_commit_num+0.5)) +
|
||||
scale(log(history_discussion_num+0.5)) +
|
||||
scale(log(history_star_num+0.5)) +
|
||||
company_null +
|
||||
email_null +
|
||||
isHireable +
|
||||
location_null +
|
||||
other_way +
|
||||
scale(log(num_repo_dependents+0.5)),
|
||||
data=df
|
||||
)
|
||||
r.squaredGLMM(m_account_commit_slope)
|
||||
|
||||
|
||||
df$intercept_change = df$after_intercept - df$before_intercept
|
||||
df$intercept_change = (df$intercept_change - min(df$intercept_change)) / max(df$intercept_change)
|
||||
|
||||
m_account_commit_intercept = lm(
|
||||
formula=scale(log(intercept_change+0.5))~
|
||||
scale(log(user_age+0.5)) +
|
||||
scale(log(min_tier+0.5)) +
|
||||
scale(log(max_tier+0.5)) +
|
||||
|
|
|
|||
Loading…
Reference in New Issue