๐ฌ [email protected]
๐ psychbruce.github.io
๐ฆ BRoadly Useful Convenient and Efficient R functions that BRing Users Concise and Elegant R data analyses.
Home Page: https://psychbruce.github.io/bruceR/
License: GNU General Public License v3.0
๐ฌ [email protected]
๐ psychbruce.github.io
Line 201 in c7c9b26
Hello, thank you very much for your contribution and effort.
I am a beginner in using the R language. I managed to install the bruceR package with the help of various online resources. I would like to know if there are any tutorials available that can help me quickly get started with bruceR.
For example, I would like to learn how to convert certain text into word vectors or perform similarity calculations.
I'm sorry for the interruption. Best wishes to you.
I cannot install bruceR. The warning seemed like Bug #4, but the soluation of Bug#04 was not work.
I had updated the R to the latest version 4.0.2, but the error still remained.
devtools::install_github("psychbruce/bruceR")
Downloading GitHub repo psychbruce/bruceR@HEAD
checking for file 'C:\Users\THINK\AppData\Local\Temp\RtmpSoK5KO\remotes48d859227c82\psychbruce-bruceR-eded61e/DESCRIPTION' ...
โ checking for file 'C:\Users\THINK\AppData\Local\Temp\RtmpSoK5KO\remotes48d859227c82\psychbruce-bruceR-eded61e/DESCRIPTION'
preparing 'bruceR':
checking DESCRIPTION meta-information ...
checking DESCRIPTION meta-information ...
โ checking DESCRIPTION meta-information
Installing package into โC:/Users/THINK/Documents/R/win-library/4.0โ
(as โlibโ is unspecified)
Bruceๅ
็ๆจๅฅฝ๏ผๅจPROCESS()็่พๅบ็ปๆไธญ็ๆจกๅ็ผๅทไธ่ก
PROCESS Model Code : 14 (Hayes, 2018; www.guilford.com/p/hayes3)
ไธญ็็ฝๅๅทฒ็ปๅคฑๆไบ๏ผ็ฐๅจๆๅผๅฎๅชไผ่ทณ่ฝฌๅฐIntroduction to Mediation, Moderation, and Conditional Process Analysis่ฟๆฌไนฆ็่ดญไนฆ้กต้ข๏ผๆไธ็ฅ้่ฟไธช็ฝ้กตๅๆฌ็ๅ
ๅฎนๆฏไปไน๏ผๆไปฅ่ฟไธชๆจกๅ็ผๅทๅฐฑๆฒกๆๆไพๅฎ้
็ๅ่ไฟกๆฏใ
ไปฅๅ๏ผbruceR็็ๆฏไธไธช้ๅธธๅฎ็จๅไพฟๆท็ๅทฅๅ
ท๏ผ่ฐข่ฐขไฝ ็่ดก็ฎใ
ๆณ้ฎไธไธชๅ
ณไบMANOVA()ๅฝๆฐ็้ฎ้ข๏ผๆ็ๅฎ้ชๆฏไธไธช้ๅคๆต้ไธคๅ ็ด ็ไธๅ ็ด ๆนๅทฎๅๆใๅจๆๅค็ๆ็ๅฎฝๆฐๆฎ็ๆถๅ๏ผๆๅ็ฐๅฝๆ็ๅๅๆฏ๏ผsec_3_t1๏ผsec_3_t6๏ผsec_9_t1๏ผsec_9_t6๏ผ็ๆถๅ่ฝๆญฃๅธธ่ฟๅ็ปๆ๏ผไฝๆฏๅๅๅๆ๏ผsec_4_t1๏ผsec_4_t6๏ผsec_10_t1๏ผsec_10_t6๏ผ็ๆถๅๅฐฑไธ่ฝๆญฃๅธธ่ฟ่กไบใๆฅ้ๅๅ ๆฏ๏ผFailed to perform MANOVA.ใๆณ้ฎไธไธๆฏๅฆๆฏๅ ไธบๅๅ็งฐ้ๅบ็ฐไบไธคไฝๆฐๅฐฑไธ่ฝๆญฃๅธธ่ฟ่กๅฝๆฐใ
ๆ็ไปฃ็ ้จๅๅฆไธ
MANOVA(data = data,
dvs=paste(c(dvs[1], dvs[4]), collapse = ":"),
dvs.pattern="sec_(.)_(t.)",
between="disease",
within=c("section", "time"),
file = file.path(wide_format_dir, basename(file)))
ๆฅ้ๅฆไธ๏ผ
Note:
dvs="sec_4_t1:sec_10_t6" is matched to variables:
sec_4_t1, sec_4_t6, sec_10_t1, sec_10_t6
Error:
Failed to perform MANOVA.
Please follow the correct usage.
See: help(MANOVA)
ๆฐๆฎ็ๅไบ่กๆ ผๅผๅฆไธ
disease sec_4_t1 sec_4_t6 sec_10_t1 sec_10_t6
0 0.148010408 0.240479665 0.137365773 0.162679725
0 0.164722607 0.208784311 0.155697349 0.131884651
0 0.128987875 0.155202186 0.123803308 0.107702303
0 0.14838339 0.212513358 0.146451598 0.19047774
0 0.134528406 0.208767676 0.108596354 0.130336021
When I run the following code,
lm1=lm(Temp ~ Month + Day, data=airquality)
lm2=lm(Temp ~ Month + Day + Wind + Solar.R, data=airquality)
model_summary(lm1)
model_summary(lm2)
model_summary(list(lm1, lm2))
model_summary(list(lm1, lm2), std=TRUE, digits=2)
model_summary(list(lm1, lm2), file="OLS Models.doc")
I received the following error
Error in output %>% stringr::str_replace_all("ย ", "") %>% stringr::str_replace_all("-", :
object 'magrittr_pipe' not found
Can you please help?
We are about to release dplyr 1.0.8 and this currently make this package fail with:
# bruceR
<details>
* Version: 0.7.3
* GitHub: https://github.com/psychbruce/bruceR
* Source code: https://github.com/cran/bruceR
* Date/Publication: 2021-11-05 17:40:01 UTC
* Number of recursive dependencies: 202
Run `cloud_details(, "bruceR")` for more info
</details>
## Newly broken
* checking examples ... ERROR
```
Running examples in โbruceR-Ex.Rโ failed
The error most likely occurred in:
> ### Name: Alpha
> ### Title: Reliability analysis (Cronbach's alpha and McDonald's omega).
> ### Aliases: Alpha
>
> ### ** Examples
>
> # ?psych::bfi
> Alpha(bfi, "E", 1:5) # "E1" & "E2" should be reverse scored
Warning: replacing previous import โggplot2::enquoโ by โjmvcore::enquoโ when loading โjmvโ
Error in jmvcore::enquo(vars) : object 'rlang_enquo' not found
Calls: Alpha -> <Anonymous> -> <Anonymous> -> <Anonymous>
Execution halted
```
This is due to this problem in jmvcore: jamovi/jmvcore#19 possibly fixed by jamovi/jmvcore#20
is this package can only be installed in R version>4.0.0?
Hello Han-Wu-Shuang Bao,
first let me say that I am amazed at how Your package works. It is exactly what I was searching for for my masters thesis.
I was trying to do a moderated multilevel mediation (1-1-1), where the moderator had an effect on all paths:
PROCESS( data_long_labs, y = "HO_sat", x = "HO_isol", meds = "HO_self", clusters = "ID", mods = "HO_cont_sup", mod.path = "all", nsim = 10)
The first part is being computed without problems, but when it starts to work on the simulations, it ends with the message:
Error in
.rowNamesDF<-(x, value = value) : invalid 'row.names' length
I tried it with a normal mediation at a single point in time, the multilevel mediation without the moderation and the moderation having an influence only on special paths + combinations of mod.path types. All of that worked perfectly fine, only the computation of the effect on all paths doesn't, also when supplied by c("x-y", "x-m", "m-y"), or even c("m-y", "x-y)".
I updated my R, RStudio and all packages and closed the R-Session multiple times.
I hope, that You can solve this problem. I will be happy to help You if I can.
Greetings from Germany!
Richard
The Traceback returned:
11.stop("invalid 'row.names' length")
10..rowNamesDF<-
(x, value = value)
9.row.names<-.data.frame
(*tmp*
, value = gsub(":", " x ", row.names(dp1)))
8.row.names<-
(*tmp*
, value = gsub(":", " x ", row.names(dp1)))
7.interaction_F_test(model, data = data, data.name = data.name)
6.interaction_test(model, data = data.c, data.name = "data.c")
5.process_mod(model.y0, model.y, data.c, x, y, mod1, mod2, mod1.val,
mod2.val, mod.type, x.label = "X", y.label = "Y", eff.tag = "(Conditional Direct Effects [c'] of X on Y)",
nsmall, file = file) at #1
4.eval(parse(text = text), envir = parent.frame())
3.eval(parse(text = text), envir = parent.frame())
2.Run(run.process.mod.xy(eff.tag = "(Conditional Direct Effects [c'] of X on Y)"))
1.PROCESS(data_long_labs, y = "HO_sat", x = "HO_isol", meds = "HO_self",
clusters = "ID", mods = "HO_cont_sup", mod.path = c("m-y",
"x-y"), nsim = 5)
Will the bruceR support the Covariance analysis (ANCOVA) ๏ผ
่ฏท้ฎๅๅฎPROCESSๅฝๆฐ็ไธญไปๅๆ๏ผๅฐคๅ ถๆฏๅคไธญไปๅ้็ไธญไปๅๆ๏ผๅฆไฝ่ฟ่กๅฏ่งๅ๏ผ็จๅชไธชๅฝๆฐๅฏไปฅๅ๏ผ
Hi,
By allowing for additional arguments (the "..." syntax in functions), one can use robust standard errors for the test.
This can be done by including ", ..." to the 'granger_test()' function on line 1 and on line 24.
Example code attached below.
Best regards
Tomas
library(sandwich)
library(lmtest)
library(bruceR)
?granger_test
granger_test_HAC <- function (formula, data, lags = 1:5, test.reverse = TRUE, file = NULL, ...) # changed here
{
installed("lmtest")
res = data.frame(Lag = lags, D1 = "", D2 = "", D12 = "")
names(res)[2:4] = c("Hypothesized Direction", "Reverse Direction",
"Hypothesized (vs. Reverse)")
if (test.reverse) {
formula.rev = as.formula(paste(formula[3], formula[1],
formula[2]))
formulas = list(formula, formula.rev)
}
else {
formulas = list(formula)
}
Print("\n \n\n <<cyan Granger Causality Test (Bivariate)>>\n\n Hypothesized direction:\n <<blue {formula[2]} ~ {formula[2]}[1:Lags] + <<green {formula[3]}[1:Lags]>>>>\n ")
for (f in formulas) {
rev = FALSE
if (test.reverse & f != formulas[[1]]) {
rev = TRUE
Print("\n \n\n Reverse direction:\n <<blue {formula[3]} ~ {formula[3]}[1:Lags] + <<green {formula[2]}[1:Lags]>>>>\n ")
}
for (lag in lags) {
gt = lmtest::grangertest(formula = f, data = data,
order = lag, na.action = na.omit, ...) # changed here
Fval = gt[2, "F"]
df1 = -gt[2, "Df"]
df2 = gt[1, "Res.Df"]
sig = str_trim(sig.trans(p.f(Fval, df1, df2)))
result = bruceR::p(f = Fval, df1 = df1, df2 = df2)
result.simple = formatF(Fval, 2) %^% ifelse(sig ==
"", "", "" %^% sig %^% "")
Print("Lags = {lag}:\t{result}")
res[which(res$Lag == lag), ifelse(rev, 3, 2)] = p.plain(f = Fval,
df1 = df1, df2 = df2)
res[which(res$Lag == lag), 4] = ifelse(rev, res[[which(res$Lag ==
lag), 4]] %^% " (vs. " %^% result.simple %^%
")", result.simple)
}
}
cat("\n")
if (!is.null(file)) {
RES = res
RES[[2]] = str_replace(str_replace(RES[[2]], "p", "p"),
"F", "F")
RES[[3]] = str_replace(str_replace(RES[[3]], "p", "p"),
"F", "F")
if (test.reverse == FALSE)
RES = RES[1:2]
print_table(RES, row.names = FALSE, digits = 0, file.align.head = "left",
file.align.text = "left", title = "Table. Granger Causality Test (Bivariate).",
note = "Note. * p < .05. ** p < .01. *** p < .001.",
file = file)
}
}
environment(granger_test_HAC) <- asNamespace('bruceR')
granger_test(chicken ~ egg, data=lmtest::ChickEgg)
granger_test_HAC(chicken ~ egg, data=lmtest::ChickEgg, vcov=vcovHAC) # HAC
Platform: Mac latestโจR Version: 4.0.2 (2020-06-22)
bruceR Version: latest (installed viaย install_github())
First of all, thanks for developing this useful and powerful package!
Here is my code:
`
library(carData)
library(car)
library(haven)
library("lme4")
library (haven)
library(tidyverse)
library(RColorBrewer)
library(lmerTest)
library (dplyr)
library(ggplot2)
library(readxl)
library("ggpubr")
library(compareGroups)
library(lmerTest)
library(RLRsim)
library(mice)
library(dplyr)
library(lattice)
library(grid)
library(DMwR)
library(bootstrap)
library(interactions)
library(jtools)
library(devtools)
library(usethis)
library(rJava)
library(reghelper)
library(pacman)
library(interactions)
library(bbmle)
library(xlsx)
library(bruceR)
lmm.fit2=lmer(trust ~(1|countrycode)+gini+gender+education+logGDP+Scarcity+social_class+age,data=gini_hlmanalysis1,REML=F)
HLM_summary(lmm.fit2)
`
Thanks for your kindly reply!
Lin
่ฟๆไฝฟ็จไธๅ ็ด ๆททๅ่ฎพ่ฎก็SPSS็ปๆๅbruceR็็ปๆไธไธๆ ท๏ผๅ
ถไธญgroupๆฏ็ป้ด๏ผtaskๅconๆฏ็ปๅ
ใtaskๅ ็ด ๆ3ไธช๏ผๅ็ฎๅๆๅบๅๆ็ๆถๅ๏ผdf2 ๅบ่ฏฅๆฏN-K๏ผNไธๅ
ฑๆฏ20ไธช๏ผ้ฃๅบ่ฏฅๆฏ17ไธชใไฝๆฏbruceR็ปๆdf2ๆฏ18ใไธ็ฅ้ๆฏไธๆฏๆๆไฝ้่ฏฏใ่ฟ็จๅๆต่ฏๆฐๆฎๅๅทฒไธไผ ใ
SPSS ่ฏญๆณ๏ผ
GLM task1con1 task2con1 task3con1 task1con2 task2con2 task3con2 BY group
/WSFACTOR=con 2 Polynomial task 3 Polynomial
/METHOD=SSTYPE(3)
/POSTHOC=group(LSD BONFERRONI)
/PLOT=PROFILE(taskgroupcon) TYPE=BAR ERRORBAR=CI MEANREFERENCE=YES
/EMMEANS=TABLES(OVERALL)
/EMMEANS=TABLES(contaskgroup) COMPAR(task) ADJ(BONFERRONI)
/PRINT=DESCRIPTIVE ETASQ PARAMETER HOMOGENEITY
/CRITERIA=ALPHA(.05)
/WSDESIGN=con task con*task
/DESIGN=group.
็ปๆ๏ผ
R ่ฏญๆณ๏ผ
library(bruceR)
set.wd()
datas <- import(file ='test.sav')
Result <- MANOVA(datas,dvs='task1con1:task3con2',dvs.pattern = 'task(.)con(.)',
between='group',within=c('task','con'),file='dpd_face.doc') %>%
#EMMEANS(effect=c('task','con'),by='group')
EMMEANS(effect='task',by=c('group','con'),model.type = "multivariate")
็ปๆ๏ผ
ๆต่ฏๆฐๆฎ๏ผ
test.zip
Dear users,
Thanks for your use of the bruceR
package. This package has passed all code checks performed by CRAN, see CRAN Package Check Results for Package bruceR. If there were any errors in the check results, then the CRAN would notify the developer immediately. However, any error appearing only in YOUR operating system but not in the CRAN check results is highly likely due to your installed (old) versions of R and/or R packages, or due to some other unknown reasons not related to bruceR
!
Although it is possible that bruceR
may still have some bugs not detected by CRAN and not noticed by me, I strongly suggest you following these steps before you decide to open/submit a new issue here:
help(function)
or ?function
).I hope all issues you came across would be automatically fixed if you follow these suggestions.
If you are sure that the bugs are relevant to the functionality of bruceR
and you have already read the help pages, then open and submit a new issue here.
Best regards,
Han-Wu-Shuang Bao
ๆจๅฅฝ๏ผๅพๆ่ฐขๆจ็ไปๅบ๏ผbruceR็็ๆฏไธไธช้ๅธธๆนไพฟ็ๅทฅๅ ทใๆๆ่ฟๅจไฝฟ็จไธญ้ๅฐไธไธช้ฎ้ข๏ผๆๆไธไธชไธคๅ ็ด ่ขซ่ฏๅ ็ๆฐๆฎ๏ผไฝๆฏๅ ถไธญไธไธชๅ ็ด ็ไธๅๆฐดๅนณไน้ด็่ฏๆฌกๆฐ้ๆฏไธไธๆ ท็๏ผ่ฟๅฏผ่ดๆๅฐไธคไธชๅ ็ด ้ฝ็บณๅ ฅๆนๅทฎๅๆไธญๆถ๏ผ่ฟ่กไบๅๆฃ้ชไฝฟ็จ็ๅๅผๆฏไธไธช็ป็ๅๅผ็ๅๅผ๏ผๅไป ่ฎก็ฎๅไธชๅ ็ด ็ๅๅผๆฏไธไธๆ ท็๏ผๅพๅบๆฅ็ๆฃ้ช็ปๆๅบ่ฏฅๆฏไธๅ็กฎ็ใ
I think this is a good job. But I have some questions. For example,this package can not installedใ
install.packages("bruceR")
Warning in install.packages :
package โbruceRโ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
Platform: Windows x64
R Version: 4.1.1 (x64)
bruceR Version: latest (installed via install_github()
)
When I tried to generate tidy report of an object returned from function lmer()
, the following error occurred:
HLM_summary(model.hlm3)
# Error in formula[[2]] : object of type 'symbol' is not subsettable
ๆ็ๆ้CFAไผฐ่ฎกๅจไผผไนๅชๆ้ป่ฎค็MLไผฐ่ฎกๅจ๏ผ็ถ่ๅ ถๅฎไธไบๅ ฅWLS็ญไผฐ่ฎกๅจไนๆฏๅพๅธธ็จ็๏ผๅฝ็ถ่ฟๆไธไบ็จณๅฅ็ไผฐ่ฎกๅจๅฆMLR็ญใๅจlavaanไธญๅฏไปฅ้่ฟ่พๅ ฅestimatorๆฅๆดๆขไผฐ่ฎกๅจ๏ผๆ็ฅ้CFAๆฏๅฏนlavaan็ปๆๅพๅฐ่ฃ ใ่ฟๅจbrucerๅ ไธญไผผไนไธๅฏไปฅๅฎ็ฐใ
ๅฏ่ฝ้่ฆๆทปๅ ไธไบๆ็คบๅ็ฅ็จๆท็ฎๅไฝฟ็จ็ๆฏไฝ็งไผฐ่ฎกๅจใ
ๆ็ฐๅจๅธๆ่ฝๅฐ็ฎๅๆๅบๅๆๅๅค้ๆฏ่พ็็ปๆไนไปฅๆๆฌ็ๅฝขๅผ่พๅบใไฝๆฏ็ฐๅจๅชๅจMANOVA()ๅฝๆฐ้ๆพๅฐไบfileๅ
ณ้ฎๅญ๏ผ่พๅบๅบๆฅ็ๅ
ๅฎนไนๅชๅ
ๅซไบๆนๅทฎๅๆ็้จๅ๏ผๅธฎๅฉๆๆกฃ้้ข็EMMEANS()่ฟไธชๅฝๆฐๆฒกๆ็ธๅ
ณ็ๅ
ณ้ฎ่ฏใ
ๅ ไธบ่ฏพ้ข่ฆๅค็็ๆฐๆฎๆฏ่พๅค๏ผๆไปฅๅฆๆ่ฝๆดๅๅฐไธไธชๆๆกฃ้่พๅบไผ่็ๅพๅคๅๅคซ๏ผๅ ไธบๆฒกๆๆพๅฐ่ฟไธชๅ่ฝๆไปฅๆๆฐไธไธไฝ่
๏ผไธ็ฅ้ๆๆฒกๆ่ฟไธชๅ่ฝ๏ผ
bruceไฝ ๅฅฝ๏ผๆไธ็ดไฝฟ็จไฝ ็ๅ ่ฟ่กไธไบๅ ๅญๅๆๅๆ่ฟฐๆง็ป่ฎกใไนๅ่ฟไธชๅ ๆไบไธไบissues๏ผๆ่ฐขไฝ ็ญๅฟ็่งฃๅณไบ่ฟไบ้ฎ้ขใ
ๆไนๅๅๆต้ไธๅๆง็ๆจกๅไธ็ด่ฆไฝฟ็จlavaan่ฏญๆณๆฅๅฎไนไธๅ็ๆจกๅ๏ผ่ฟๆพๅพๅพ็น็ใๆ็ๆๅฐsemtoolsๆพๆไธไธชๆต้ไธๅๆง็ๅฝๆฐ๏ผไธ่ฟ็ฎๅๅทฒ็ปๅบๅผ่ขซๆดๅบๅฑ็ๅฝๆฐๅไปฃไบใ็ฎๅRไธญ็ผบๅฐ่ฝ็ฎๅ็ๆต้ไธๅๆง็ๅฝๆฐ๏ผๅณไฝฟๆไนๅนถไธๅฅฝ็จ๏ผๅฆๆไธไธชๅ psycmodelไธญๆไธไธชๆต้ไธๅๆง็ๅฝๆฐ๏ผ็ถ่ๅดๆฒกๆณๅฎไนไผฐ่ฎกๅจไปฅๅๆต้็ๆจกๅ้ถๆฐ่พๅฐ๏ผใ
ๆๆณไฝ ๆฏๅฆๆๅ ๅ ฅ่ฟไธๅฝๆฐ็ๆณๆณใๆต้ไธๅๆงไนๆฏๅ ๅญๅๆไธญ็้่ฆๅ ๅฎน๏ผๆ่งๅพไฝ ๅฆๆๅ ๅ ฅ่ฟไธชๅฝๆฐ็่ฏๅฏไปฅๅ ๅ ฅไธไบๆฏๅฆ้่ฟไธๅๆงๆต่ฏ็ๆ่ฟฐใไฝ ๅฏไปฅๅ่ไธไธpsycmodelไธญ็ๅฎ็ฐhttps://jasonmoy28.github.io/psycModel/reference/measurement_invariance.htmlใ
ๅไธๆฌกๆ่ฐขไฝ ไธบๅคงๅฎถๅธฆๆฅๅฆๆญคๆ็จ็ๅทฅๅ ทใ
just like the title.
After updated my R packages, when I use MANOVA
function, I get the following error:
MSE = Mean Square Error (an estimate of the population variance ฯยฒ)
ANOVA Effect Size:
Error in `$<-.data.frame`(`*tmp*`, "p.value", value = character(0)) :
replacement has 0 rows, data has 3
But this error was not occurred before, how to solve this error.
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] cowplot_1.1.1 performance_0.6.1 data.table_1.13.6 rio_0.5.16
[5] bruceR_0.5.4 ggstatsplot_0.6.6 psych_2.0.12 lsr_0.5
[9] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.2 purrr_0.3.4
[13] readr_1.4.0 tidyr_1.1.2 tibble_3.0.4 ggplot2_3.3.3
[17] tidyverse_1.3.0
Hi Bruce, thanks for your effort to make this package! It is terrific and really makes ANOVA easy.
Would there be any way to save APA-style ANOVA output as a word document? I did know an r package named apaTables (https://github.com/dstanley4/apaTables) can achieve this goal, but it can not provide effect size and its CI.
It will be great to see how bruceR become better and better!
ๆจๅฅฝ๏ผๆๅจไฝฟ็จbruceRๆถ๏ผ็จMANOVA่ฎก็ฎๅๅ ็ด ้ๅคๆต้ๆนๅทฎๅๆ็็ปๆ๏ผๆฐๆฎ่พๅ ฅ็ๆฏ้ฟๆฐๆฎ๏ผ่ฎก็ฎไธๅๆญฃๅธธใไฝๆฏๅฝๆๆmodel่พๅ ฅๅฐEMMEANS๏ผๅนถๆๅฎbyไธบ่ขซ่ฏๅ ๅ ็ด ๆถ๏ผไผๆฅ้ๆ็คบ๏ผโThere are no factors to testโใ่ฏท้ฎๆฏๅ ไธบๆ่พๅ ฅๆฐๆฎไธบ้ฟๆฐๆฎ็ๅๅ ๅ๏ผ่ฐข่ฐขๆจ๏ผ
Dear bruce,
I am using PROCESS in bruceR for modelling, however I have found a problem with the display. When I run model 7, the values of the covariates are incorrectly substituting the values of the direct effects. You can see this in the code below,I have used the example dataset data
from your help file for this example
As you can see in the section Direct Effect: "parent_edu" (X) ==> "score" (Y)
it shows a coefficient of -0.444, which should be the coefficient of partjob. Not the coefficient of the direct effect, which is 3.581 instead.
> PROCESS(data, y="score", x="parent_edu",
+ meds=c("family_inc"),
+ mod.path = c("x-m"),
+ mods="gender",
+ covs=c("partjob"))
************ PART 1. Regression Model Summary ************
PROCESS Model Code : 7 (Hayes, 2018; www.guilford.com/p/hayes3)
PROCESS Model Type : Moderated Mediation
- Outcome (Y) : score
- Predictor (X) : parent_edu
- Mediators (M) : family_inc
- Moderators (W) : gender
- Covariates (C) : partjob
- Level-2 Clusters : -
All numeric predictors have been mean-centered.
Formula of Mediator:
- family_inc ~ partjob + parent_edu*gender
Formula of Outcome:
- score ~ partjob + parent_edu + gender + family_inc
Model Summary
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
(1) score (2) family_inc (3) score
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
(Intercept) 51.912 *** 9.207 *** 51.261 ***
(0.094) (0.030) (0.126)
partjob -0.298 0.132 ** -0.444 *
(0.194) (0.045) (0.187)
parent_edu 5.546 *** 1.786 *** 3.581 ***
(0.190) (0.061) (0.199)
genderMale 0.107 * 1.358 ***
(0.044) (0.182)
parent_edu:genderMale 0.021
(0.089)
family_inc 1.086 ***
(0.042)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
R^2 0.081 0.146 0.145
Adj. R^2 0.081 0.146 0.145
Num. obs. 9679 9679 9679
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Note. * p < .05, ** p < .01, *** p < .001.
************ PART 2. Mediation/Moderation Effect Estimate ************
Package Use : โmediationโ (v4.5.0), โinteractionsโ (v1.1.5)
Effect Type : Moderated Mediation (Model 7)
Sample Size : 9679
Random Seed : set.seed()
Simulations : 100 (Bootstrap)
Warning: nsim=1000 (or larger) is suggested!
Direct Effect: "parent_edu" (X) ==> "score" (Y)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Effect S.E. t p [95% CI]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Direct (c') -0.444 (0.187) -2.372 .018 * [-0.811, -0.077]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Interaction Effect on "family_inc" (M)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
F df1 df2 p
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
parent_edu x gender 0.05 1 9674 .815
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Simple Slopes: "parent_edu" (X) ==> "family_inc" (M)
(Conditional Effects [a] of X on M)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
"gender" Effect S.E. t p [95% CI]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Female 1.786 (0.061) 29.104 <.001 *** [1.665, 1.906]
Male 1.806 (0.064) 28.294 <.001 *** [1.681, 1.932]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Running 100 * 2 simulations...
Indirect Path: "parent_edu" (X) ==> "family_inc" (M) ==> "score" (Y)
(Conditional Indirect Effects [ab] of X through M on Y)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
"gender" Effect S.E. z p [Boot 95% CI]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Female 1.940 (0.110) 17.650 <.001 *** [1.725, 2.109]
Male 1.962 (0.085) 23.009 <.001 *** [1.825, 2.149]
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Percentile Bootstrap Confidence Interval
(SE and CI are estimated based on 100 Bootstrap samples.)
Note. The results based on bootstrapping or other random processes
are unlikely identical to other statistical software (e.g., SPSS).
To make results reproducible, you need to set a seed (any number).
Please see the help page for details: help(PROCESS)
Ignore this note if you have already set a seed. :)
Hopeing this will help you.
Based on the documentation, I think the Alpha function required the item to be in the format of common var name + unique var name (e.g., a1 , a2, a3 should be written as var = a, items = 1:3). However, in practice, that's not always the case to have a common var name follow by a unique var name. For example, I want to use the item Q67, Q88, Q89a, Q89b, Q89c, and it is not supported by the Alpha function (at least I don't know how to do it by reading the documentation)
I think it would be much more useful if the function supports subsetting using the dplyr::select() syntax and the helpers (e.g., everything(), starts_with()).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.