├── .DS_Store ├── .RData ├── .Rbuildignore ├── .Rhistory ├── .gitattributes ├── .gitignore ├── CRAN-RELEASE ├── CRAN-SUBMISSION ├── DESCRIPTION ├── NAMESPACE ├── NEWS.md ├── R ├── .DS_Store ├── CorPlot.R ├── addCatVars.R ├── catMediation.R ├── compareMC.R ├── conceptDiagram.R ├── condPlot.R ├── condPlot2.R ├── condPlotCat.R ├── condPlotCat2.R ├── conditionalEffectPlot.R ├── densityPlot.R ├── drawCatModel.R ├── drawConcept.R ├── drawModel.R ├── education.R ├── extractIMM.R ├── internal.R ├── labels2table.R ├── makeCatEquation.R ├── makeEquation.R ├── makePPTx.R ├── matrixPlot.R ├── meanSummary.R ├── mediationBK.R ├── modSummary.R ├── modSummary2.R ├── modSummary3.R ├── modelsSummary.R ├── modelsSummary2.R ├── modmedEquation.R ├── modmedSummary.R ├── multipleMediation.R ├── pmacroModel.R ├── r2diff.R ├── regEquation.R ├── reliabilityTable.R ├── showModels.R ├── statisticalDiagram.R ├── teachers.R ├── tripleInteraction.R └── ztable.modelSummary.R ├── README.md ├── cran-comments.md ├── data ├── caskets.rda ├── disaster.rda ├── education.rda ├── estress.rda ├── glbwarm.rda ├── moreModels.rda ├── nodes.rda ├── parrows.rda ├── pmacro.rda ├── pmi.rda ├── protest.rda ├── teachers.rda └── teams.rda ├── figure ├── .DS_Store ├── fig1.png ├── fig2.png ├── fig3.png ├── fig4.png ├── fig5.png ├── table1.png ├── table2.png ├── table3.png └── table4.png ├── inst ├── .DS_Store ├── figures │ └── imgfile.png ├── showModels │ └── app.R └── test │ ├── test.R │ └── test.R.zip ├── man ├── addArrows.Rd ├── addCatVars.Rd ├── addCovarEquation.Rd ├── addLabels.Rd ├── addLatentNodes.Rd ├── addLine.Rd ├── addNodes.Rd ├── addPlus.Rd ├── addTripleInteraction.Rd ├── adjustNodes.Rd ├── adjustPosNodes.Rd ├── adjustxpos.Rd ├── adjustypos.Rd ├── appendLabels.Rd ├── bda.mediation.test.Rd ├── caskets.Rd ├── catMediation.Rd ├── centerPrint.Rd ├── changeLabelName.Rd ├── checkEqVars.Rd ├── checkEquationVars.Rd ├── compareMC.Rd ├── compareMCTable.Rd ├── compareVIF.Rd ├── compareVIFTable.Rd ├── conceptDiagram.Rd ├── conceptDiagram2.Rd ├── condPlot.Rd ├── condPlot2.Rd ├── condPlotCat.Rd ├── condPlotCat2.Rd ├── conditionalEffectPlot.Rd ├── convertPvalue.Rd ├── corPlot.Rd ├── corTable.Rd ├── corTable2.Rd ├── countM.Rd ├── covar2df.Rd ├── deleteSingleNumber.Rd ├── densityPlot.Rd ├── disaster.Rd ├── discriminantValidityTable.Rd ├── discriminantValidityTable2.Rd ├── divideEquation.Rd ├── drawArrows.Rd ├── drawCatModel.Rd ├── drawConcept.Rd ├── drawCovar.Rd ├── drawModel.Rd ├── drawStatDiagram.Rd ├── drawtext.Rd ├── education.Rd ├── eq2df.Rd ├── eq2fit.Rd ├── eq2var.Rd ├── equations2var.Rd ├── est2Arrows.Rd ├── est2Nodes.Rd ├── estimatesTable.Rd ├── estimatesTable2.Rd ├── estress.Rd ├── extractIMM.Rd ├── extractLatentVar.Rd ├── extractLatentVarName.Rd ├── extractModerator.Rd ├── extractNumber.Rd ├── extractRange.Rd ├── extractX.Rd ├── findName.Rd ├── findNames.Rd ├── fit2alpha.Rd ├── fit2df2.Rd ├── fit2table.Rd ├── fit2vif.Rd ├── fun2eq.Rd ├── get2ndIndirect.Rd ├── getArrows.Rd ├── getAspectRatio.Rd ├── getBootData.Rd ├── getCatSlopeDf.Rd ├── getCoef.Rd ├── getEq2p.Rd ├── getHelmert.Rd ├── getInfo.Rd ├── getMeanSd.Rd ├── getNodes.Rd ├── getRatioTable.Rd ├── getRepValues.Rd ├── getYhat.Rd ├── getYhat1.Rd ├── ggCor.Rd ├── glbwarm.Rd ├── interactStr.Rd ├── jnPlot.Rd ├── label2name.Rd ├── labels2table.Rd ├── makeAnovaDf.Rd ├── makeCEDf.Rd ├── makeCatEquation.Rd ├── makeCatEquation2.Rd ├── makeCatEquation3.Rd ├── makeCatModel.Rd ├── makeCoefLabel.Rd ├── makeEquation.Rd ├── makeEquation1.Rd ├── makeEquation2.Rd ├── makeEquation3.Rd ├── makeIndirectEquation.Rd ├── makeIndirectEquationCat.Rd ├── makeIndirectEquationCat2.Rd ├── makeLabel.Rd ├── makePPTx.Rd ├── matrix2df.Rd ├── matrix2no.Rd ├── matrixPlot.Rd ├── meanCentering.Rd ├── meanSummary.Rd ├── meanSummaryTable.Rd ├── medSummary.Rd ├── medSummaryTable.Rd ├── medSummaryTable1.Rd ├── medSummaryTable2.Rd ├── mediationBK.Rd ├── modSummary.Rd ├── modSummary2.Rd ├── modSummary2Table.Rd ├── modSummary3.Rd ├── modSummary3Table.Rd ├── modSummaryTable.Rd ├── modelFitGuideTable.Rd ├── modelFitGuideTable2.Rd ├── modelFitTable.Rd ├── modelFitTable2.Rd ├── modelsSummary.Rd ├── modelsSummary2.Rd ├── modelsSummary2Table.Rd ├── modelsSummaryTable.Rd ├── moderator2df.Rd ├── moderator2pos.Rd ├── modmedEquation.Rd ├── modmedSummary.Rd ├── modmedSummary2Table.Rd ├── modmedSummaryTable.Rd ├── moreModels.Rd ├── multipleMediation.Rd ├── myarrow.Rd ├── myarrow2.Rd ├── mycat.Rd ├── mycor.Rd ├── myflatten.Rd ├── myformat.Rd ├── mylm.Rd ├── nodes.Rd ├── numberSubscript.Rd ├── p2asterisk.Rd ├── p2chr.Rd ├── parallelMatrix.Rd ├── parrows.Rd ├── pastecolon.Rd ├── pformat.Rd ├── plot.mediationBK.Rd ├── plotCoef.Rd ├── pmacro.Rd ├── pmacroModel.Rd ├── pmi.Rd ├── print.compareVIF.Rd ├── print.meanSummary.Rd ├── print.medSummary.Rd ├── print.medSummary2.Rd ├── print.mediationBK.Rd ├── print.modSummary.Rd ├── print.modelSummary.Rd ├── print.modelSummary2.Rd ├── print.modmedSummary.Rd ├── print.modmedSummary2.Rd ├── productEq.Rd ├── protest.Rd ├── qqPlot.Rd ├── r2diff.Rd ├── r2pptx.Rd ├── regEquation.Rd ├── reliabilityTable.Rd ├── reliabilityTable2.Rd ├── removeParentheses.Rd ├── rightPrint.Rd ├── seekGroup.Rd ├── seekGroup1.Rd ├── seekGroup2.Rd ├── seekNameVars.Rd ├── seekVar.Rd ├── separateEq.Rd ├── setPositionNodes.Rd ├── showModels.Rd ├── standardize.Rd ├── standardizeDf.Rd ├── statisticalDiagram.Rd ├── str2vector.Rd ├── strGrouping.Rd ├── str_detect2.Rd ├── str_setdiff.Rd ├── sumEquation.Rd ├── summary.mediationBK.Rd ├── teachers.Rd ├── teams.Rd ├── theme_clean2.Rd ├── treatInteraction.Rd ├── treatModerator.Rd ├── tripleEquation.Rd ├── tripleInteraction.Rd ├── unfold.Rd ├── vars2df.Rd ├── vif.Rd ├── ztable.compareMC.Rd └── ztable.modelSummary.Rd ├── processR.Rproj └── vignettes ├── .DS_Store ├── .gitignore └── processR.Rmd /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/.DS_Store -------------------------------------------------------------------------------- /.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/.RData -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^CRAN-RELEASE$ 2 | ^.*\.Rproj$ 3 | ^\.Rproj\.user$ 4 | ^figure$ 5 | cran-comments.md 6 | ^CRAN-SUBMISSION$ 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | inst/doc 2 | .Rproj.user 3 | -------------------------------------------------------------------------------- /CRAN-RELEASE: -------------------------------------------------------------------------------- 1 | This package was submitted to CRAN on 2021-01-06. 2 | Once it is accepted, delete this file and tag the release (commit 5d98f09). 3 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 0.2.7 2 | Date: 2023-01-20 04:48:09 UTC 3 | SHA: 1bbd18879064f5b7238b112faecccf807fc04424 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: processR 2 | Type: Package 3 | Title: Implementation of the 'PROCESS' Macro 4 | Version: 0.2.8 5 | URL: https://github.com/cardiomoon/processR 6 | BugReports: https://github.com/cardiomoon/processR/issues 7 | Authors@R: c(person("Keon-Woong","Moon", role=c("aut", "cre"), 8 | email="cardiomoon@gmail.com"), 9 | person("Sokyoung","Hong",role=c("ctb"), email="hsychild@hanmail.net")) 10 | Description: Perform moderation, mediation, moderated mediation and moderated moderation. 11 | Inspired from famous 'PROCESS' macro for 'SPSS' and 'SAS' created by Andrew Hayes. 12 | Depends: 13 | R (>= 2.10) 14 | Date: 2023-4-13 15 | License: GPL-2 16 | Encoding: UTF-8 17 | LazyData: true 18 | Imports: 19 | lavaan, 20 | diagram, 21 | dplyr, 22 | flextable(>= 0.5.8), 23 | ggplot2(>= 3.1.1), 24 | ggrepel, 25 | officer, 26 | psych, 27 | purrr, 28 | rrtable, 29 | semTools, 30 | stringr, 31 | tidyselect, 32 | rlang, 33 | tidyr, 34 | predict3d(>= 0.1.3.3), 35 | interactions, 36 | ztable, 37 | rmarkdown 38 | Suggests: 39 | shiny, 40 | shinyWidgets, 41 | knitr, 42 | readr 43 | RoxygenNote: 7.2.3 44 | VignetteBuilder: knitr 45 | -------------------------------------------------------------------------------- /R/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/R/.DS_Store -------------------------------------------------------------------------------- /R/densityPlot.R: -------------------------------------------------------------------------------- 1 | #' Get bootstrapped values 2 | #' @param semfit An object of class lavaan 3 | #' @param what Character. What needs to be inspected/extracted? 4 | #' @param ... Further argument to be passed to lavaan::lavTech() 5 | #' @importFrom lavaan lavTech 6 | #' @importFrom utils packageVersion 7 | #' @export 8 | #' @examples 9 | #' require(lavaan) 10 | #' labels=list(X="cond",M="pmi",Y="reaction") 11 | #' model=tripleEquation(labels=labels) 12 | #' \donttest{ 13 | #' set.seed(1234) 14 | #' semfit=sem(model,data=pmi,se="boot",bootstrap=100) 15 | #' getBootData(semfit) 16 | #' } 17 | getBootData=function(semfit,what="coef.boot",...){ 18 | if(packageVersion("lavaan")<"0.6.5.1453") { 19 | cat("To use this function, please install the latest 'lavaan' package using the following R code.\n") 20 | cat("install.packages('lavaan',repos='http://www.da.ugent.be',type='source')\n") 21 | } 22 | as.data.frame(lavTech(semfit, what=what, add.labels = TRUE,...)) 23 | 24 | } 25 | 26 | 27 | #' Draw Smoothed Kernel density plot 28 | #' @param x A numeric vector 29 | #' @param sig significant level. Default value is 0.05 30 | #' @param digits Integer indicating the number of decimal places 31 | #' @param xlab character. x axis label 32 | #' @param ylab character. y axis label 33 | #' @importFrom ggplot2 ggplot geom_histogram annotate labs geom_line 34 | #' @importFrom predict3d theme_bw2 35 | #' @export 36 | #' @examples 37 | #' require(lavaan) 38 | #' labels=list(X="cond",M="pmi",Y="reaction") 39 | #' model=tripleEquation(labels=labels) 40 | #' \donttest{ 41 | #' set.seed(1234) 42 | #' semfit=sem(model,data=pmi,se="boot",bootstrap=100) 43 | #' bootData=getBootData(semfit) 44 | #' bootData$indirect=bootData$a*bootData$b 45 | #' densityPlot(bootData$indirect) 46 | #' } 47 | densityPlot=function(x,sig=0.05,digits=3,xlab="Indirect effect(ab)",ylab=NULL){ 48 | if(is.null(ylab)){ 49 | ylab=paste0("Smoothed Kernel density estimates \nin ",length(x)," bootstrap samples") 50 | } 51 | df=as.data.frame(x=x) 52 | xintercept=quantile(x,probs=c(sig/2,1-sig/2),type=6,na.rm=TRUE) 53 | labels=sprintf(paste0("%0.",digits,"f"),xintercept) 54 | 55 | p<-ggplot(data=df,aes_string(x="x",y="..density.."))+ 56 | geom_histogram(color="grey60",fill="cornsilk")+ 57 | geom_line(stat="density",color="red") 58 | 59 | res=getAspectRatio(p) 60 | 61 | p<-p+ geom_vline(xintercept=xintercept[1],lty=2)+ 62 | geom_vline(xintercept=xintercept[2],lty=2)+ 63 | annotate("text",x=xintercept[1],y=res$ymax,label=labels[1],hjust=1.1)+ 64 | annotate("text",x=xintercept[2],y=res$ymax,label=labels[2],hjust=-0.1)+ 65 | labs(x=xlab,y=ylab)+ 66 | theme_bw2() 67 | p 68 | } 69 | 70 | #' Draw quantile-quantile plot 71 | #' @param x A numeric vector 72 | #' @param linecolor character line color 73 | #' @param xlab character label for x axis 74 | #' @param ylab character label for y axis 75 | #' @param title character label for plot title 76 | #' @param ... Further arguments to be passed to geom_qq() 77 | #' @export 78 | #' @importFrom ggplot2 geom_qq geom_qq_line labs element_text 79 | #' @examples 80 | #' qqPlot(rnorm(200)) 81 | #' qqPlot(rt(200, df = 5)) 82 | qqPlot=function(x,linecolor="red",xlab=NULL,ylab=NULL,title=NULL,...){ 83 | if(is.null(xlab)) xlab="Theoretical Quantiles" 84 | if(is.null(ylab)) ylab="Sample Quantiles" 85 | if(is.null(title)) title="Normal Q-Q Plot" 86 | ggplot(data=as.data.frame(x),aes(sample=x))+geom_qq(...)+ 87 | geom_qq_line(col=linecolor)+ 88 | theme_bw2()+ 89 | labs(title=title,x=xlab,y=ylab)+ 90 | theme(plot.title=element_text(hjust=0.5)) 91 | } 92 | -------------------------------------------------------------------------------- /R/extractIMM.R: -------------------------------------------------------------------------------- 1 | #'Extract name of moderator from string 2 | #'@param string A string 3 | #'@export 4 | #'@examples 5 | #'string="(a1+a3*age.mean)*(b1+b3*age.mean)" 6 | #'string="(a1+a3*age.mean)*(b)" 7 | #'string="(a1+a3*4.12)*(b)" 8 | #'string="(a)*(b)" 9 | #'extractNumber(string) 10 | #'extractModerator(string) 11 | extractModerator=function(string){ 12 | if(str_detect(string,"\\)\\*\\(")){ 13 | temp=unlist(strsplit(string,"\\)\\*\\(")) 14 | temp[1]=str_replace(temp[1],"\\(","") 15 | temp[2]=str_replace(temp[2],"\\)","") 16 | } else{ 17 | temp=string 18 | } 19 | temp=unlist(strsplit(temp,"\\+")) 20 | temp=unlist(strsplit(temp,"\\*")) 21 | res=unique(temp[str_detect(temp,"mean")]) 22 | if(length(res)==0) { 23 | res=unique(extractNumber(string)) 24 | } 25 | res 26 | } 27 | 28 | #' extract index of moderated mediation from string 29 | #' @param string A string 30 | #' @export 31 | #' @examples 32 | #'string="(a1+a3*age.mean)*(b1+b3*age.mean)" 33 | #'string="(a1+a3*skeptic.mean)*(b1+b2*skeptic.mean+b4*Z.mean)" 34 | #'string="(a1+a3*age.mean)*(b)" 35 | #'string="(a1+a3*4.12)*(b)" 36 | #'string="(a)*(b)" 37 | #'extractIMM(string) 38 | extractIMM=function(string){ 39 | mod=extractModerator(string) 40 | if(is.null(mod)) return(NULL) 41 | string=str_replace_all(string,mod,"W") 42 | string 43 | temp=unlist(strsplit(string,"\\)\\*\\(")) 44 | temp[1]=str_replace(temp[1],"\\(","") 45 | temp[2]=str_replace(temp[2],"\\)","") 46 | templist=strsplit(temp,"\\+") 47 | result=c() 48 | for(i in seq_along(templist[[1]])){ 49 | for(j in seq_along(templist[[2]])){ 50 | result=c(result,paste0(templist[[1]][i],"*",templist[[2]][j])) 51 | } 52 | } 53 | result=result[str_detect(result,"W")] 54 | result=str_replace(result,"\\*W","") 55 | result=paste0(result,collapse="+") 56 | result 57 | if(str_detect(result,"W")) return(NULL) 58 | result 59 | } 60 | 61 | -------------------------------------------------------------------------------- /R/modSummary2.R: -------------------------------------------------------------------------------- 1 | #' Make table summarizing moderation effect 2 | #' @param fit An object of class lm 3 | #' @param rangemode An integer. If 1, mean+c(-1,0,1)*sd used. If 2, 16th, 50th and 84th percentiles are used 4 | #' @param pred.values Values of predictor variables 5 | #' @param summarymode An integer. 1 or 2. Summarizing method of variables. If 1, typical values are used. If 2, mean values are used 6 | #' @param maxylev An integer. Maximum length of predictor variables to be treated as a categorical variable. 7 | #' @param digits An integer indicating the number of decimal places 8 | #' @param labels Optional list of labels of variables 9 | #' @param ... Further arguments to be passed to predict3d::fit2newdata() 10 | #' @importFrom predict3d fit2newdata 11 | #' @importFrom stringr str_detect 12 | #' @export 13 | #' @examples 14 | #' labels=list(X="negemot",W="sex",Z="age",Y="govact",C1="posemot",C2="ideology") 15 | #' fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 16 | #' modSummary2(fit,rangemode=2,mod2.values=c(30,50,70),summarymode=2) 17 | #' modSummary2(fit,mod2.values=c(30,50,70),summarymode=1,labels=labels) 18 | #' labels=list(X="frame",W="skeptic",Y="justify") 19 | #' fit=lm(justify~frame*skeptic,data=disaster) 20 | #' modSummary2(fit,labels=labels) 21 | modSummary2=function(fit,rangemode=2,pred.values=NULL,summarymode=2,maxylev=6,digits=3,labels=NULL,...){ 22 | # rangemode=2;pred.values=NULL;summarymode=2;maxylev=6;digits=3 23 | temp=names(fit$coef)[str_detect(names(fit$coef),":")] 24 | vars=unique(unlist(strsplit(temp,":"))) 25 | if(is.null(pred.values)){ 26 | x=fit$model[[vars[1]]] 27 | if(length(unique(x))<=maxylev){ 28 | pred.values=sort(unique(x)) 29 | } else if(rangemode==1) { 30 | pred.values=mean(x,na.rm=TRUE)+c(-1,0,1)*sd(x,na.rm=TRUE) 31 | } else{ 32 | pred.values=quantile(x,probs=c(0.16,0.50,0.84),type=6) 33 | } 34 | } 35 | df=fit2newdata(fit,predictors=vars,mode=rangemode,pred.values=pred.values, 36 | summarymode=summarymode,...) 37 | # df=fit2newdata(fit,predictors=vars,mode=rangemode,pred.values=pred.values, 38 | # summarymode=summarymode) 39 | 40 | df[]=lapply(df,myformat,digits=digits) 41 | if(!is.null(labels)) { 42 | finalNames=changeLabelName(colnames(df),labels,add=TRUE) 43 | colnames(df)=finalNames 44 | } 45 | df 46 | } 47 | 48 | #' Make flextable summarizing moderation effect 49 | #' @param x An object 50 | #' @param vanilla logical 51 | #' @param ... Further argument to be passed to modSummary3 52 | #' @export 53 | #' @examples 54 | #' fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 55 | #' modSummary2Table(fit) 56 | modSummary2Table=function(x,vanilla=TRUE,...){ 57 | if("lm" %in% class(x)) x=modSummary2(x,...) 58 | rrtable::df2flextable(x,vanilla=vanilla) 59 | } 60 | 61 | -------------------------------------------------------------------------------- /R/r2diff.R: -------------------------------------------------------------------------------- 1 | #' Calculate difference of R2 and adjusted R2 2 | #' @param fit An object of class lm 3 | #' @param mode Integer If 1, remove all interaction. If 2, remove variables one by one 4 | #' @param digits Integer indicating the number of decimal places 5 | #' @importFrom stringr str_detect 6 | #' @importFrom stats anova 7 | #' @export 8 | #' @examples 9 | #' fit=lm(mpg~wt*hp,data=mtcars) 10 | #' r2diff(fit) 11 | #' r2diff(fit,mode=2) 12 | r2diff=function(fit,mode=1,digits=3){ 13 | 14 | # mode=1; digits=3;all.interaction=TRUE 15 | fit.r2=summary(fit)$r.squared 16 | fit.adj.r2=summary(fit)$adj.r.squared 17 | vars=names(fit$coef)[-1] 18 | df=fit$model 19 | r2=c() 20 | adj.r2=c() 21 | f=c() 22 | df1=c() 23 | df2=c() 24 | p=c() 25 | if(mode==1){ 26 | temp=vars[!str_detect(vars,":")] 27 | eq=paste0(names(df)[1],"~",paste0(temp,collapse="+")) 28 | fit1=lm(as.formula(eq),data=df) 29 | r2=c(r2,summary(fit1)$r.squared) 30 | adj.r2=c(adj.r2,summary(fit1)$adj.r.squared) 31 | result=anova(fit1,fit) 32 | f=c(f,result$F[2]) 33 | df1=c(df1,result$Df[2]) 34 | df2=c(df2,summary(fit)$df[2]) 35 | p=c(p,result$`Pr(>F)`[2]) 36 | 37 | } else{ 38 | for(i in 1:length(vars)){ 39 | temp=vars[-i] 40 | eq=paste0(names(df)[1],"~",paste0(temp,collapse="+")) 41 | fit1=lm(as.formula(eq),data=df) 42 | r2=c(r2,summary(fit1)$r.squared) 43 | adj.r2=c(adj.r2,summary(fit1)$adj.r.squared) 44 | result=anova(fit1,fit) 45 | f=c(f,result$F[2]) 46 | df1=c(df1,result$Df[2]) 47 | df2=c(df2,summary(fit)$df[2]) 48 | p=c(p,result$`Pr(>F)`[2]) 49 | 50 | } 51 | } 52 | r2diff=fit.r2-r2 53 | ar2diff=fit.adj.r2-adj.r2 54 | df=data.frame(r2diff=r2diff,ar2diff=ar2diff,F=f,df1=df1,df2=df2,p=p) 55 | df 56 | if(mode!=1) rownames(df)=vars 57 | if(!is.null(digits)){ 58 | for(i in c(1,2,3,6)){ 59 | df[[i]]=myformat(df[[i]],digits) 60 | } 61 | df[[6]]=pformat(df[[6]]) 62 | } 63 | if(mode==1){ 64 | tempvars=vars[str_detect(vars,":")] 65 | cat("Test of highest order unconditional interaction(s)\n\n") 66 | 67 | if(length(tempvars)>0){ 68 | cat("Removing : ",paste0(tempvars,collapse=","),"\n") 69 | temp=paste0("r2diff = ",df$r2diff,", F(",df$df1,",",df$df2,") = ",df$F,", p = ",df$p) 70 | cat(temp,"\n") 71 | } else{ 72 | cat("There is no interaction in the model.") 73 | } 74 | 75 | invisible(df) 76 | } else{ 77 | df 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /R/regEquation.R: -------------------------------------------------------------------------------- 1 | #'Make regression equation 2 | #' @param X A character vectors indicating independent variables 3 | #' @param M A character vectors indicating mediators 4 | #' @param Y A character vectors indicating dependent variables 5 | #' @param moderator moderator 6 | #' @param covar covariates 7 | #' @param secondIndirect A logical 8 | #' @export 9 | #' @examples 10 | #' X="X";M=NULL;Y="Y"; moderator=list(name="W",site=list("c")) 11 | #' regEquation(X,M,Y,moderator) 12 | #' M=c("M1","M2") 13 | #' regEquation(X,M,Y,moderator,secondIndirect=TRUE) 14 | #' covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M1","Y"),"Y","Y")) 15 | #' regEquation(X,M,Y,moderator,covar=covar) 16 | #' covar=list(name=c("ese","sex","tenure"),site=list(c("M","Y"),c("M","Y"),c("M","Y"))) 17 | #' regEquation(X="estress",M="affect",Y="withdraw",covar=covar) 18 | regEquation=function(X="X",M=NULL,Y="Y",moderator=list(),covar=list(),secondIndirect=FALSE){ 19 | # moderator=list();secondIndirect=FALSE 20 | # X="estress";M="affect";Y="withdraw" 21 | (XM=moderator$name[str_detect2(moderator$site,"a")]) 22 | (MY=moderator$name[str_detect2(moderator$site,"b")]) 23 | (XY=moderator$name[str_detect2(moderator$site,"c")]) 24 | 25 | equation=list() 26 | count=1 27 | if(!is.null(M)){ 28 | for(i in 1:length(M)){ 29 | equation[[count]]=paste0(M[i],"~",X ) 30 | if((i>1)&(secondIndirect)){ 31 | temp=M[1:(i-1)] 32 | temp=paste0(temp,collapse="+") 33 | equation[[count]]=paste0(equation[[count]],"+",temp) 34 | } 35 | count=count+1 36 | } 37 | } 38 | temp=c(X) 39 | if(!is.null(M)){ 40 | temp=c(temp,M) 41 | } 42 | if(length(XY)>0) { 43 | for(i in 1:length(XY)){ 44 | temp=c(temp,paste0(X,"*",XY[i])) 45 | } 46 | } 47 | temp=paste0(temp,collapse="+") 48 | equation[[count]]=paste(Y,"~",temp) 49 | equation2=paste0(unlist(equation),collapse="\n") 50 | 51 | equation2=addCovarEquation(equation2,covar=covar,prefix=NULL) 52 | equation2 53 | } 54 | 55 | #' Make a list of objects of class lm 56 | #' @param equations equations for linear regression 57 | #' @param data A data.frame 58 | #' @return a list of objects of class lm 59 | #' @importFrom stats as.formula lm 60 | #' @export 61 | eq2fit=function(equations,data){ 62 | eq=unlist(strsplit(equations,"\n")) 63 | count=length(eq) 64 | fit=lapply(1:count,function(i) { 65 | eval(parse(text=paste0("lm(",eq[i],",data=data)"))) 66 | }) 67 | fit 68 | } 69 | -------------------------------------------------------------------------------- /R/reliabilityTable.R: -------------------------------------------------------------------------------- 1 | #' make discriminant Validity Table 2 | #' @param fit An object of a class lavaan 3 | #' @importFrom semTools reliability 4 | #' @importFrom lavaan inspect 5 | #' @export 6 | discriminantValidityTable=function(fit){ 7 | result=tryCatch(semTools::reliability(fit),error= function(e) "error") 8 | if("character" %in% class(result)) { 9 | result<-NULL 10 | } else{ 11 | result=rbind(result,sqrtave=sqrt(result[5,])) 12 | df=as.data.frame(t(result[,-ncol(result)])) 13 | 14 | colnames(df)[5]="AVE" 15 | colnames(df)[6]="sqrt(AVE)" 16 | result1=inspect(fit,"cor.lv") 17 | diag(result1)<-NA 18 | 19 | discriminantValidity<-as.character(df[[6]]>apply(result1,1,max,na.rm=TRUE)) 20 | #discriminantValidity 21 | diag(result1)<-1 22 | rdf=as.data.frame(result1) 23 | 24 | result=cbind(rdf,df[5:6]) 25 | result=round(result,3) 26 | result=cbind(result,discriminantValidity) 27 | 28 | } 29 | result 30 | } 31 | 32 | #' make discriminant Validity Table in flextable format 33 | #' @param fit An object of a class lavaan 34 | #' @param vanilla Logical 35 | #' @export 36 | discriminantValidityTable2=function(fit,vanilla=FALSE){ 37 | result=tryCatch(semTools::reliability(fit),error= function(e) "error") 38 | 39 | if("character" %in% class(result)) { 40 | result<-NULL 41 | } else{ 42 | result=discriminantValidityTable(fit) 43 | result<-df2flextable(result,add.rownames = TRUE,vanilla=vanilla) 44 | } 45 | result 46 | } 47 | 48 | 49 | #' make reliability Table 50 | #' @param fit An object of a class lavaan 51 | #' @export 52 | reliabilityTable=function(fit){ 53 | result=tryCatch(semTools::reliability(fit),error= function(e) "error") 54 | if("character" %in% class(result)) { 55 | result<-NULL 56 | } else{ 57 | result=rbind(result,sqrtave=sqrt(result[5,])) 58 | df=as.data.frame(round(t(result),3)) 59 | colnames(df)[5]="AVE" 60 | colnames(df)[6]="sqrt(AVE)" 61 | df$Reliablity=as.character((df$omega>=0.7)&(df$alpha>=0.7)) 62 | df$convergenceValidity=as.character(df$AVE>=0.5) 63 | result<-df 64 | } 65 | result 66 | } 67 | 68 | #' make reliability Table in flextable format 69 | #' @param fit An object of a class lavaan 70 | #' @param vanilla Logical 71 | #' @importFrom flextable width 72 | #' @export 73 | reliabilityTable2=function(fit,vanilla=FALSE){ 74 | result=tryCatch(semTools::reliability(fit),error= function(e) "error") 75 | result 76 | if("character" %in% class(result)) { 77 | result<-NULL 78 | } else{ 79 | df<-reliabilityTable(fit) 80 | result<-df2flextable(df,add.rownames=TRUE,vanilla=vanilla) 81 | result<-width(result,j=1:(ncol(df)+1),width=c(1,1,1,1,1,1,1.5,1.5,1.5)) 82 | } 83 | result 84 | } 85 | 86 | #' Model fit guide table 87 | #' @export 88 | modelFitGuideTable=function(){ 89 | 90 | x2df="< 3" 91 | p="> 0.05" 92 | CFI="> 0.9" 93 | GFI="> 0.9" 94 | AGFI="> 0.9" 95 | TLI="> 0.9" 96 | RMR="< 0.05" 97 | SRMR="< 0.05" 98 | RMESA="< 0.1(< 0.05)" 99 | AIC="the lower, the better" 100 | BIC="the lower, the better" 101 | result=data.frame(x2df,p,CFI,GFI,AGFI,TLI,RMR,SRMR,RMESA,AIC,BIC) 102 | result 103 | } 104 | 105 | #' Model fit guide table 106 | #' @param vanilla Logical 107 | #' @export 108 | modelFitGuideTable2=function(vanilla=FALSE){ 109 | 110 | result=modelFitGuideTable() 111 | df2flextable(result,vanilla=vanilla) 112 | } 113 | 114 | -------------------------------------------------------------------------------- /R/showModels.R: -------------------------------------------------------------------------------- 1 | #' Run process macro shiny app 2 | #' @importFrom utils install.packages 3 | #' @export 4 | showModels=function(){ 5 | 6 | if(!requireNamespace("shiny")) install.packages("shiny") 7 | if(!requireNamespace("shinyWidgets")) install.packages("shinyWidgets") 8 | shiny::runApp(system.file('showModels',package='processR')) 9 | } 10 | -------------------------------------------------------------------------------- /R/teachers.R: -------------------------------------------------------------------------------- 1 | #'Teacher Efficacy Data 2 | #' 3 | #'A dataset containing teacher efficacy, social support, psychological wellbeing and job stress of 247 teachers working in kindergarten 4 | #' 5 | #'@format A data.frame with 247 rows and 7 variables: 6 | #'\describe{ 7 | #' \item{age}{teacher's age. 1: 20-24, 2: 25-29, 3: 30-34, 4: 35-39, 5: 40-44, 6:45-49, 7: 50 or above } 8 | #' \item{marriage}{Marital Status. 0: single, 2: married} 9 | #' \item{children}{Parental Status. 0: no children, 1: one or more children} 10 | #' \item{wellbeing}{Psychological Well-being} 11 | #' \item{stress}{Job stress. A response syndrome of negative affects(such as anger or depression) resulting from the teacher's job} 12 | #' \item{efficacy}{Teacher Efficacy. A judgement of his or her capabilities to bring about desired outcomes of student engagement and learning} 13 | #' \item{support}{Social Support. Various resources provided by ones's interpersonal ties.} 14 | #'} 15 | #'@source {Cohen, S., & Hoberman, H. M. (1983). Positive events and social support as butters of life change stress. Journal of Social Applied Psychology, 13, 99-125} 16 | #'@source {Tschannen-Moran, M., & Hoy, A. W. (2001). Teacher efficacy: Capturing an elusive construct. Teaching and teacher education, 17(7), 783-805} 17 | #'@source {Ryff, Carol D. (1989). Happiness Is Everything, or Is It? Explorationson the Meaning of Psychological Well-Being. Journal of-Personality and Social Psychology, 57, 1069-1081} 18 | #'@source {Kyriacou, C., & Sutcliffe, J. (1978). Teacher stress: Prevalence, sources, and symptoms. British Journal of Educational Psychology, 55, 61-64} 19 | "teachers" 20 | -------------------------------------------------------------------------------- /R/ztable.modelSummary.R: -------------------------------------------------------------------------------- 1 | #' S3 method for class 'modelSummary' 2 | #'@param x An object of class modelSummary 3 | #'@param digits integer indicating the number of decimal places 4 | #'@param ... Further argument to be passed to ztable 5 | #'@importFrom dplyr select 6 | #'@importFrom ztable ztable addcgroup spanCol hlines 7 | #'@export 8 | ztable.modelSummary=function(x,digits=NULL,...){ 9 | count=ncol(x)/4 10 | count 11 | 12 | modelNames=attr(x,"modelNames") 13 | selected=c() 14 | align=c("c") 15 | for(i in 1:count){ 16 | if(i% select(selected) 26 | class(x1)="data.frame" 27 | align=paste0(align,collapse = "") 28 | z=ztable::ztable(x1,align=align,...) 29 | 30 | newnames=c() 31 | newModelNames=c() 32 | ncgroup=c() 33 | for(i in 1:count){ 34 | newnames=c(newnames,c("Coef","SE","t","p")) 35 | newModelNames=c(newModelNames,modelNames[i]) 36 | ncgroup=c(ncgroup,4) 37 | if(i% 45 | addcgroup(cgroup=newModelNames,n.cgroup=ncgroup) %>% 46 | addcgroup(cgroup="Consequent",n.cgroup=ncol(x1),top=TRUE) %>% 47 | hlines(add=nrow(z$x)-5) 48 | 49 | colnames(z$x)=newnames 50 | for(i in 1:count){ 51 | for(j in 1:5){ 52 | z=spanCol(z,row=nrow(x1)+1-(j-1),from=2+(i-1)*5,to=5+(i-1)*5) 53 | } 54 | 55 | } 56 | z 57 | 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | R package processR 2 | ========================================================= 3 | [![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/processR)](https://cran.r-project.org/package=processR) 4 | 5 | 6 | The `processR` package aims to be a user-friendly way to perform moderation, mediation, moderated mediation and moderated moderation in R. This package is inspired from famous PROCESS macro for SPSS and SAS created by Andrew Hayes. 7 | 8 | **processR is under the GPL-3 license. For a commercial license, please 9 | [contact me](mailto: cardiomoon@gmail.com).** 10 | 11 | ## PROCESS macro and R package `processR` 12 | 13 | Andrew F. Hayes was not involved in the development of this R package or application and cannot attest to the quality of the computations implemented in the code you are using. Use at your own risk. 14 | 15 | ## Installation 16 | 17 | You can install the `processR` package from github. 18 | 19 | 20 | ```r 21 | if(!require(devtools)) install.packages("devtools") 22 | devtools::install_github("cardiomoon/processR") 23 | ``` 24 | 25 | ## What does this package cover ? 26 | 27 | The `processR` package covers moderation, mediation, moderated mediation and moderated moderation with R. Supporting models are as follows. 28 | 29 | 30 | ```r 31 | library(processR) 32 | sort(pmacro$no) 33 | ``` 34 | 35 | ``` 36 | [1] 0.0 1.0 2.0 3.0 4.0 4.2 5.0 6.0 6.3 6.4 7.0 8.0 9.0 10.0 37 | [15] 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 21.0 22.0 23.0 24.0 38 | [29] 28.0 29.0 30.0 31.0 35.0 36.0 40.0 41.0 45.0 49.0 50.0 58.0 59.0 60.0 39 | [43] 61.0 62.0 63.0 64.0 65.0 66.0 67.0 74.0 75.0 76.0 40 | ``` 41 | 42 | Currently, 52 models are supported. 43 | 44 | ## Example: Moderated Mediation (PROCESS macro model 8) 45 | 46 | I will explain functions of processR package by a example. 47 | 48 | ## Concept Diagram and Statistical Diagram 49 | 50 | You can draw concept diagram and statistical diagram easily. For example, you can draw the concept diagram for PROCESS macro model 8. 51 | 52 | 53 | ```r 54 | pmacroModel(8) 55 | ``` 56 | 57 | 58 | 59 | 60 | You can draw statistical diagram of this model. 61 | 62 | 63 | ```r 64 | statisticalDiagram(8) 65 | ``` 66 | 67 | 68 | 69 | 70 | ## Full vignette 71 | 72 | You can see full vignette for model 8 at http://rpubs.com/cardiomoon/468602 73 | 74 | 75 | ## Shiny App 76 | 77 | I have developed a shiny app. You can test the app at https://cardiomoon.shinyapps.io/processR. 78 | I will appreciate any comment. 79 | 80 | ## How to perform this analysis with shiny app 81 | 82 | You can see how to perform this analysis at http://rpubs.com/cardiomoon/468600 83 | 84 | ## Sample powerpoint file 85 | 86 | In the shiny app, you can download the analysis results as a powerpoint file. You can download the sample file [model8.pptx](https://github.com/cardiomoon/processRDocs/blob/master/model8/model8.pptx?raw=true) - view with [office web viewer](https://view.officeapps.live.com/op/view.aspx?src=https://github.com/cardiomoon/processRDocs/blob/master/model8/model8.pptx?raw=true). 87 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | This is the new submission of the package 'processR'. 2 | 3 | Package was archived on CRAN. 4 | X-CRAN-Comment: Archived on 2023-02-02 as requires archived package 5 | 'predict3d'. 6 | 7 | The 'predict3d' package is on CRAN now. 8 | 9 | ## Test environments 10 | * local OS X install, R 4.2.3 11 | * win-builder (devel and release) 12 | * R-hub 13 | 14 | ## R CMD check results 15 | There were no ERRORs or WARNINGs. 16 | 17 | 18 | -------------------------------------------------------------------------------- /data/caskets.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/caskets.rda -------------------------------------------------------------------------------- /data/disaster.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/disaster.rda -------------------------------------------------------------------------------- /data/education.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/education.rda -------------------------------------------------------------------------------- /data/estress.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/estress.rda -------------------------------------------------------------------------------- /data/glbwarm.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/glbwarm.rda -------------------------------------------------------------------------------- /data/moreModels.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/moreModels.rda -------------------------------------------------------------------------------- /data/nodes.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/nodes.rda -------------------------------------------------------------------------------- /data/parrows.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/parrows.rda -------------------------------------------------------------------------------- /data/pmacro.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/pmacro.rda -------------------------------------------------------------------------------- /data/pmi.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/pmi.rda -------------------------------------------------------------------------------- /data/protest.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/protest.rda -------------------------------------------------------------------------------- /data/teachers.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/teachers.rda -------------------------------------------------------------------------------- /data/teams.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/data/teams.rda -------------------------------------------------------------------------------- /figure/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/.DS_Store -------------------------------------------------------------------------------- /figure/fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/fig1.png -------------------------------------------------------------------------------- /figure/fig2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/fig2.png -------------------------------------------------------------------------------- /figure/fig3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/fig3.png -------------------------------------------------------------------------------- /figure/fig4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/fig4.png -------------------------------------------------------------------------------- /figure/fig5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/fig5.png -------------------------------------------------------------------------------- /figure/table1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/table1.png -------------------------------------------------------------------------------- /figure/table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/table2.png -------------------------------------------------------------------------------- /figure/table3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/table3.png -------------------------------------------------------------------------------- /figure/table4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/figure/table4.png -------------------------------------------------------------------------------- /inst/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/inst/.DS_Store -------------------------------------------------------------------------------- /inst/figures/imgfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/inst/figures/imgfile.png -------------------------------------------------------------------------------- /inst/showModels/app.R: -------------------------------------------------------------------------------- 1 | library(shiny) 2 | library(shinyWidgets) 3 | library(processR) 4 | 5 | ui=fluidPage( 6 | h2("Select Process Macro Model Number"), 7 | fluidRow( 8 | column(2, 9 | selectInput("modelno","Model No",choices=sort(pmacro$no),selectize=FALSE,size=28) 10 | ), 11 | column(10, 12 | 13 | radioGroupButtons( 14 | inputId = "plotChoice", 15 | label = "Select Plot", 16 | choices = c("Conceptual Diagram"=1, "Statistical Diagram"=2), 17 | status = "primary" 18 | ), 19 | 20 | plotOutput("modelPlot",height="500px",width="700px") 21 | ) 22 | ) 23 | ) 24 | 25 | server=function(input,output,session){ 26 | output$modelPlot=renderPlot({ 27 | par(family=input$font) 28 | 29 | if(input$plotChoice==1) { 30 | pmacroModel(as.numeric(input$modelno)) 31 | } else{ 32 | statisticalDiagram(as.numeric(input$modelno)) 33 | } 34 | 35 | }) 36 | } 37 | shinyApp(ui,server) 38 | -------------------------------------------------------------------------------- /inst/test/test.R: -------------------------------------------------------------------------------- 1 | # Model Summary Table 2 | require(processR) 3 | fit=lm(justify~skeptic*frame,data=disaster) 4 | labels=list(X="skeptic",W="frame",Y="justify") 5 | summary(fit) 6 | 7 | ## Model Summary Table 8 | modelsSummaryTable(list(fit),labels=labels) %>% width(j=1,width=1.6) %>% 9 | align(j=1,align="center",part="all") 10 | 11 | condPlot(fit,rangemode=2,xpos=0.7) 12 | 13 | 14 | condPlot(fit,mode=2,xpos=0.6) 15 | 16 | 17 | condPlot(fit,mode=3,rangemode=2,xpos=0.5) 18 | 19 | ## Johnson-Neyman Plot 20 | jnPlot(fit) 21 | 22 | -------------------------------------------------------------------------------- /inst/test/test.R.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/inst/test/test.R.zip -------------------------------------------------------------------------------- /man/addArrows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{addArrows} 4 | \alias{addArrows} 5 | \title{Add covariates to arrows} 6 | \usage{ 7 | addArrows(arrows, covar) 8 | } 9 | \arguments{ 10 | \item{arrows}{A data.frame} 11 | 12 | \item{covar}{A list of covariates} 13 | } 14 | \description{ 15 | Add covariates to arrows 16 | } 17 | -------------------------------------------------------------------------------- /man/addCatVars.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/addCatVars.R 3 | \name{addCatVars} 4 | \alias{addCatVars} 5 | \title{Add dummy vars to data.frame} 6 | \usage{ 7 | addCatVars(df, varnames, groupLetter = "D", mode = 1) 8 | } 9 | \arguments{ 10 | \item{df}{A data.frame} 11 | 12 | \item{varnames}{Variable name to be converted as factor and add dummies} 13 | 14 | \item{groupLetter}{A character} 15 | 16 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 17 | } 18 | \description{ 19 | Add dummy vars to data.frame 20 | } 21 | \examples{ 22 | mtcars1=addCatVars(mtcars,c("cyl","carb")) 23 | mtcars1[c(3:5),] 24 | mtcars2=addCatVars(mtcars,c("cyl","carb"),mode=3) 25 | mtcars2[c(3:5),] 26 | protest1=addCatVars(protest,"protest") 27 | head(protest1) 28 | iris1=addCatVars(iris,c("Species"),mode=3) 29 | (iris1[c(1,51,101),]) 30 | } 31 | -------------------------------------------------------------------------------- /man/addCovarEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{addCovarEquation} 4 | \alias{addCovarEquation} 5 | \title{Add covariates to equation} 6 | \usage{ 7 | addCovarEquation( 8 | equation, 9 | covar = list(), 10 | prefix = "f", 11 | grouplabels = NULL, 12 | multipleMediator = FALSE 13 | ) 14 | } 15 | \arguments{ 16 | \item{equation}{The equation} 17 | 18 | \item{covar}{A list} 19 | 20 | \item{prefix}{prefix} 21 | 22 | \item{grouplabels}{A list} 23 | 24 | \item{multipleMediator}{logical} 25 | } 26 | \description{ 27 | Add covariates to equation 28 | } 29 | \examples{ 30 | equation="M ~ X*W\nY ~ a1*M + C1*X" 31 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M","Y"),"Y","Y")) 32 | grouplabels=list(C1="e") 33 | addCovarEquation(equation,covar=covar) 34 | equation="M1 ~ a11*X\nM2 ~ a12*M" 35 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M1","Y"),"M2","M2")) 36 | addCovarEquation(equation,covar=covar,multipleMediator=TRUE) 37 | addCovarEquation(equation,covar=covar) 38 | } 39 | -------------------------------------------------------------------------------- /man/addLabels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/labels2table.R 3 | \name{addLabels} 4 | \alias{addLabels} 5 | \title{add name to labels} 6 | \usage{ 7 | addLabels(labels, id, name) 8 | } 9 | \arguments{ 10 | \item{labels}{A list} 11 | 12 | \item{id}{label id} 13 | 14 | \item{name}{A character} 15 | } 16 | \description{ 17 | add name to labels 18 | } 19 | \examples{ 20 | labels=c(X="X",M="M",Y="Y") 21 | addLabels(labels,"W","X") 22 | addLabels(labels,"W","W") 23 | } 24 | -------------------------------------------------------------------------------- /man/addLatentNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{addLatentNodes} 4 | \alias{addLatentNodes} 5 | \title{Add latent nodes information to nodes} 6 | \usage{ 7 | addLatentNodes(nodes, fit, labels) 8 | } 9 | \arguments{ 10 | \item{nodes}{A data.frame} 11 | 12 | \item{fit}{An object of class lavaan. Result of lavaan::sem()} 13 | 14 | \item{labels}{A list} 15 | } 16 | \description{ 17 | Add latent nodes information to nodes 18 | } 19 | -------------------------------------------------------------------------------- /man/addLine.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{addLine} 4 | \alias{addLine} 5 | \title{Add line feed to string} 6 | \usage{ 7 | addLine(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A string} 11 | 12 | \item{...}{one or more R objects, to be converted to character vectors.} 13 | } 14 | \description{ 15 | Add line feed to string 16 | } 17 | -------------------------------------------------------------------------------- /man/addNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{addNodes} 4 | \alias{addNodes} 5 | \title{Add covariates to nodes} 6 | \usage{ 7 | addNodes(nodes, covar, radx = 0.1, rady = 0.04, no = NULL) 8 | } 9 | \arguments{ 10 | \item{nodes}{A data.frame} 11 | 12 | \item{covar}{A list of covariates} 13 | 14 | \item{radx}{horizontal radius of the box.} 15 | 16 | \item{rady}{vertical radius of the box.} 17 | 18 | \item{no}{A numeric} 19 | } 20 | \description{ 21 | Add covariates to nodes 22 | } 23 | -------------------------------------------------------------------------------- /man/addPlus.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{addPlus} 4 | \alias{addPlus} 5 | \title{Add `+` mark to string} 6 | \usage{ 7 | addPlus(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A string} 11 | 12 | \item{...}{one or more R objects, to be converted to character vectors.} 13 | } 14 | \description{ 15 | Add `+` mark to string 16 | } 17 | -------------------------------------------------------------------------------- /man/addTripleInteraction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeCatEquation.R 3 | \name{addTripleInteraction} 4 | \alias{addTripleInteraction} 5 | \title{Add triple interaction} 6 | \usage{ 7 | addTripleInteraction(res, names, interactionNo = 0, mode = 1) 8 | } 9 | \arguments{ 10 | \item{res}{A character vector} 11 | 12 | \item{names}{A character vector} 13 | 14 | \item{interactionNo}{A numeric} 15 | 16 | \item{mode}{a numeric} 17 | } 18 | \description{ 19 | Add triple interaction 20 | } 21 | -------------------------------------------------------------------------------- /man/adjustNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{adjustNodes} 4 | \alias{adjustNodes} 5 | \title{Adjust y position of nodes} 6 | \usage{ 7 | adjustNodes(nodes) 8 | } 9 | \arguments{ 10 | \item{nodes}{A data.frame} 11 | } 12 | \description{ 13 | Adjust y position of nodes 14 | } 15 | -------------------------------------------------------------------------------- /man/adjustPosNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{adjustPosNodes} 4 | \alias{adjustPosNodes} 5 | \title{Adjust position of nodes} 6 | \usage{ 7 | adjustPosNodes(nodes) 8 | } 9 | \arguments{ 10 | \item{nodes}{A data.frame} 11 | } 12 | \description{ 13 | Adjust position of nodes 14 | } 15 | -------------------------------------------------------------------------------- /man/adjustxpos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{adjustxpos} 4 | \alias{adjustxpos} 5 | \title{Adjust x position} 6 | \usage{ 7 | adjustxpos(xpos, xmargin = 0.01, radx = 0.12, xspace = NULL, mode = 1) 8 | } 9 | \arguments{ 10 | \item{xpos}{x position} 11 | 12 | \item{xmargin}{horizontal margin of plot} 13 | 14 | \item{radx}{horizontal radius of the box} 15 | 16 | \item{xspace}{numeric. horizontal interval} 17 | 18 | \item{mode}{integer adjust mode} 19 | } 20 | \description{ 21 | Adjust x position 22 | } 23 | -------------------------------------------------------------------------------- /man/adjustypos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawModel.R 3 | \name{adjustypos} 4 | \alias{adjustypos} 5 | \title{Adjust y position} 6 | \usage{ 7 | adjustypos( 8 | ypos, 9 | ymargin = 0.02, 10 | rady = 0.06, 11 | maxypos = 0.6, 12 | minypos = 0, 13 | totalOnly = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{ypos}{y position} 18 | 19 | \item{ymargin}{vertical margin of plot} 20 | 21 | \item{rady}{vertical radius of the box} 22 | 23 | \item{maxypos}{maximal y position of X or W variables} 24 | 25 | \item{minypos}{minimal y position of X or W variables} 26 | 27 | \item{totalOnly}{logical if TRUE, arrange ypos with center 0.5} 28 | } 29 | \description{ 30 | Adjust y position 31 | } 32 | \examples{ 33 | ypos=c(0.5,0.9,1,1,2,3) 34 | adjustypos(ypos) 35 | adjustypos(ypos,totalOnly=TRUE) 36 | } 37 | -------------------------------------------------------------------------------- /man/appendLabels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/labels2table.R 3 | \name{appendLabels} 4 | \alias{appendLabels} 5 | \title{Append labels from vars, moderator and covar} 6 | \usage{ 7 | appendLabels(labels, vars = list(), moderator = list(), covar = NULL) 8 | } 9 | \arguments{ 10 | \item{labels}{A list} 11 | 12 | \item{vars}{A list} 13 | 14 | \item{moderator}{A list} 15 | 16 | \item{covar}{A list} 17 | } 18 | \description{ 19 | Append labels from vars, moderator and covar 20 | } 21 | -------------------------------------------------------------------------------- /man/bda.mediation.test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mediationBK.R 3 | \name{bda.mediation.test} 4 | \alias{bda.mediation.test} 5 | \title{The Sobel mediation test} 6 | \usage{ 7 | bda.mediation.test(mv, iv, dv) 8 | } 9 | \arguments{ 10 | \item{mv}{The mediator variable} 11 | 12 | \item{iv}{The independent variable} 13 | 14 | \item{dv}{The dependent variable} 15 | } 16 | \description{ 17 | To compute statistics and p-values for the Sobel test. Results for three versions of "Sobel test" are provided: Sobel test, Aroian test and Goodman test. 18 | } 19 | -------------------------------------------------------------------------------- /man/caskets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{caskets} 5 | \alias{caskets} 6 | \title{CASKETS dataset} 7 | \format{ 8 | A data.frame with 541 obs. of 7 variables 9 | \describe{ 10 | \item{policy}{Given information about policy (0 = No information, 1 = Told About Policy)} 11 | \item{interest}{Interest in viewing casket images} 12 | \item{age}{Participant age} 13 | \item{educ}{Participant education level, 1 = less than high school, 2 = high school, 3 = some college, 4 = associates or technical school, 5 = bachelor degree, 6 = some graduate school, 7 = graduate degree } 14 | \item{male}{Participant sex (0 = female, 1 = male)} 15 | \item{conserv}{Participant social conservatism} 16 | \item{kerry}{Kerry or Bush supporter, 0 = bush supporter, 1 = kerry supporter} 17 | } 18 | } 19 | \source{ 20 | Hayes, A. F., & Reineke, J. B. (2007). The effects of government censorship of war-related news coverage on interest in the censored coverage: A test of competing theories. Mass Communication and Society, 10, 423-438 21 | 22 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 23 | } 24 | \usage{ 25 | caskets 26 | } 27 | \description{ 28 | CASKETS dataset 29 | } 30 | \keyword{datasets} 31 | -------------------------------------------------------------------------------- /man/catMediation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/catMediation.R 3 | \name{catMediation} 4 | \alias{catMediation} 5 | \title{Make Mediation Equation with one categorical variable} 6 | \usage{ 7 | catMediation( 8 | X = NULL, 9 | M = NULL, 10 | Y = NULL, 11 | labels = list(), 12 | data, 13 | moderator = list(), 14 | covar = NULL, 15 | mode = 0, 16 | maxylev = 2, 17 | range = TRUE, 18 | rangemode = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{X}{Name of independent variable} 23 | 24 | \item{M}{Name of mediator variable} 25 | 26 | \item{Y}{Name of dependent variable} 27 | 28 | \item{labels}{optional list} 29 | 30 | \item{data}{A data.frame} 31 | 32 | \item{moderator}{A list} 33 | 34 | \item{covar}{A list of covariates} 35 | 36 | \item{mode}{A numeric. 0: SEM equation, 1: regression equation} 37 | 38 | \item{maxylev}{maximal unique length of categorical variable} 39 | 40 | \item{range}{A logical} 41 | 42 | \item{rangemode}{range mode} 43 | } 44 | \description{ 45 | Make Mediation Equation with one categorical variable 46 | } 47 | \examples{ 48 | labels=list(X="cyl",M="am",Y="mpg") 49 | moderator=list(name=c("cyl","wt"),site=list(c("a","c"),c("c"))) 50 | covar=list(name=c("carb","disp"),label=c("carb","disp"),site=list(c("M","Y"),"Y","Y")) 51 | cat(catMediation(labels=labels,data=mtcars)) 52 | cat(catMediation(X="am",Y="mpg",data=mtcars,moderator=moderator,covar=covar,maxylev=6)) 53 | cat(catMediation(X="am",Y="mpg",data=mtcars,moderator=moderator,covar=covar)) 54 | cat(catMediation(X="cyl",M="am",Y="mpg",data=mtcars)) 55 | cat(catMediation(X="cyl",M="am",Y="mpg",data=mtcars,moderator=moderator)) 56 | cat(catMediation(X="cyl",M="am",Y="mpg",data=mtcars,moderator=moderator)) 57 | cat(catMediation(X="am",M="hp",Y="mpg",data=mtcars,moderator=moderator,maxylev=6)) 58 | cat(catMediation(X="hp",M="am",Y="mpg",data=mtcars,maxylev=6)) 59 | cat(catMediation(X="am",M="hp",Y="mpg",data=mtcars,moderator=moderator,covar=covar)) 60 | } 61 | -------------------------------------------------------------------------------- /man/centerPrint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{centerPrint} 4 | \alias{centerPrint} 5 | \title{Print a string in center} 6 | \usage{ 7 | centerPrint(string, width) 8 | } 9 | \arguments{ 10 | \item{string}{A string} 11 | 12 | \item{width}{A numeric} 13 | } 14 | \description{ 15 | Print a string in center 16 | } 17 | -------------------------------------------------------------------------------- /man/changeLabelName.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{changeLabelName} 4 | \alias{changeLabelName} 5 | \title{Change Label Names} 6 | \usage{ 7 | changeLabelName(x, labels, add = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{A character vector} 11 | 12 | \item{labels}{A list} 13 | 14 | \item{add}{A logical} 15 | } 16 | \description{ 17 | Change Label Names 18 | } 19 | \examples{ 20 | labels=list(X="frame:test",Mi="empathy",Y="intervention",W="frame",Z="test") 21 | x=c("skeptic","test","empathy","skeptic:frame:test","D1:frame","frame:test") 22 | changeLabelName(x,labels) 23 | changeLabelName(x,labels,add=TRUE) 24 | x=c("baby","milk","baby:milk") 25 | labels=list(X="baby",M=c("wine","tent","sand"),Y="tile",W="milk") 26 | changeLabelName(x,labels) 27 | } 28 | -------------------------------------------------------------------------------- /man/checkEqVars.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{checkEqVars} 4 | \alias{checkEqVars} 5 | \title{Check dependent variables in a equation} 6 | \usage{ 7 | checkEqVars(eq) 8 | } 9 | \arguments{ 10 | \item{eq}{A string of regression formula} 11 | } 12 | \description{ 13 | Check dependent variables in a equation 14 | } 15 | \examples{ 16 | eq="M2~X+M+X+X*M*W" 17 | checkEqVars(eq) 18 | eq="Y~M+W+M:W+X+W+X:W" 19 | checkEqVars(eq) 20 | } 21 | -------------------------------------------------------------------------------- /man/checkEquationVars.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{checkEquationVars} 4 | \alias{checkEquationVars} 5 | \title{Check dependent variables in equations} 6 | \usage{ 7 | checkEquationVars(equation) 8 | } 9 | \arguments{ 10 | \item{equation}{A string of regression formula} 11 | } 12 | \description{ 13 | Check dependent variables in equations 14 | } 15 | \examples{ 16 | equation="M1~X*M*W+W*Z\nM2~X+M1+X" 17 | checkEquationVars(equation) 18 | } 19 | -------------------------------------------------------------------------------- /man/compareMC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{compareMC} 4 | \alias{compareMC} 5 | \title{Compare effects of mean-centering and standardization of model} 6 | \usage{ 7 | compareMC(fit, mode = 1) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class 'lm'} 11 | 12 | \item{mode}{integer} 13 | } 14 | \value{ 15 | if mode is 1, an object of modelSummary2. Otherwise lift of models 16 | } 17 | \description{ 18 | Compare effects of mean-centering and standardization of model 19 | } 20 | \examples{ 21 | fit=lm(govact~negemot*age,data=glbwarm) 22 | compareMC(fit) 23 | compareMC(fit,mode=2) 24 | } 25 | -------------------------------------------------------------------------------- /man/compareMCTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{compareMCTable} 4 | \alias{compareMCTable} 5 | \title{Make table comparing effects of mean-centering and standardization of model} 6 | \usage{ 7 | compareMCTable(fit, vanilla = TRUE) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class 'lm'} 11 | 12 | \item{vanilla}{logical.} 13 | } 14 | \description{ 15 | Make table comparing effects of mean-centering and standardization of model 16 | } 17 | -------------------------------------------------------------------------------- /man/compareVIF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{compareVIF} 4 | \alias{compareVIF} 5 | \title{Compare correlation, tolerance, vif of mean-centered and standardized models} 6 | \usage{ 7 | compareVIF(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lm} 11 | } 12 | \description{ 13 | Compare correlation, tolerance, vif of mean-centered and standardized models 14 | } 15 | \examples{ 16 | fit=lm(govact~negemot*age,data=glbwarm) 17 | compareVIF(fit) 18 | } 19 | -------------------------------------------------------------------------------- /man/compareVIFTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{compareVIFTable} 4 | \alias{compareVIFTable} 5 | \title{Make table comparing correlation, tolerance, vif of mean-centered and standardized models} 6 | \usage{ 7 | compareVIFTable(fit, vanilla = TRUE) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lm} 11 | 12 | \item{vanilla}{logical} 13 | } 14 | \description{ 15 | Make table comparing correlation, tolerance, vif of mean-centered and standardized models 16 | } 17 | \examples{ 18 | fit=lm(govact~negemot*age,data=glbwarm) 19 | compareVIFTable(fit) 20 | compareVIFTable(fit,vanilla=FALSE) 21 | } 22 | -------------------------------------------------------------------------------- /man/conceptDiagram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{conceptDiagram} 4 | \alias{conceptDiagram} 5 | \title{Make conceptDiagram} 6 | \usage{ 7 | conceptDiagram(fit, labels = NULL) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | 12 | \item{labels}{labels} 13 | } 14 | \description{ 15 | Make conceptDiagram 16 | } 17 | -------------------------------------------------------------------------------- /man/conceptDiagram2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{conceptDiagram2} 4 | \alias{conceptDiagram2} 5 | \title{Make concept Diagram} 6 | \usage{ 7 | conceptDiagram2( 8 | X = "X", 9 | M = "M", 10 | Y = "Y", 11 | latent = rep(FALSE, 3), 12 | xb = FALSE, 13 | mc = FALSE, 14 | radx = 0.06, 15 | rady = 0.06, 16 | xmargin = 0.03, 17 | yinterval = NULL, 18 | box.col = "white", 19 | xlim = NULL, 20 | ylim = NULL, 21 | moderator = list(), 22 | labels = list(), 23 | covar = list() 24 | ) 25 | } 26 | \arguments{ 27 | \item{X}{character Name of independent variable} 28 | 29 | \item{M}{character Name of mediator variable} 30 | 31 | \item{Y}{character Name of dependent variable} 32 | 33 | \item{latent}{Logical. whether or not X,Y and Z are latent variables or not} 34 | 35 | \item{xb}{Logical. if positive draw line between X and (Y+Z)} 36 | 37 | \item{mc}{Logical. if positive draw line between M and (X+Y)} 38 | 39 | \item{radx}{horizontal radius of the box.} 40 | 41 | \item{rady}{vertical radius of the box.} 42 | 43 | \item{xmargin}{horizontal margin of plot} 44 | 45 | \item{yinterval}{vertical interval between box} 46 | 47 | \item{box.col}{fill color of box} 48 | 49 | \item{xlim}{the x limits (min,max) of the plot} 50 | 51 | \item{ylim}{the y limits (min,max) of the plot} 52 | 53 | \item{moderator}{optional list of moderators} 54 | 55 | \item{labels}{optional labels of X,Y and Z variables} 56 | 57 | \item{covar}{covariate optional list of covariates} 58 | } 59 | \description{ 60 | Make concept Diagram 61 | } 62 | \examples{ 63 | labels=list(X="Time Spent in\n Grad School", M="# of\n Publications", Y="# of Job Offers") 64 | conceptDiagram2(xb=TRUE,labels=labels) 65 | moderator=list(name="Z1",label="Time Spent\n with Alex",pos=3, 66 | site=list(c("a","b","c")),latent=FALSE) 67 | conceptDiagram2(moderator=moderator,labels=labels) 68 | moderator=list(name=c("Z1","Z2"),label=c("Time Spent\n with Alex","Z2label"),pos=c(3,3), 69 | site=list(c("a","b","c"),c("b","c")),latent=c(FALSE,FALSE)) 70 | conceptDiagram2(moderator=moderator,labels=labels,yinterval=0.4) 71 | covar=list(name=c("C1","C2"),label=c("sex","tenure"),site=list(c("Y"),c("Y"))) 72 | conceptDiagram2(M=NULL,moderator=list(name="M",pos=4,site=list("c"),latent=FALSE),covar=covar) 73 | conceptDiagram2(covar=covar) 74 | } 75 | -------------------------------------------------------------------------------- /man/condPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot.R 3 | \name{condPlot} 4 | \alias{condPlot} 5 | \title{Draw conditional effect plot} 6 | \usage{ 7 | condPlot( 8 | fit, 9 | xmode = 1, 10 | pred = NULL, 11 | modx = NULL, 12 | pred.values = NULL, 13 | modx.values = NULL, 14 | labels = NULL, 15 | mode = 1, 16 | rangemode = 1, 17 | ypos = NULL, 18 | hjust = NULL, 19 | linecolor = "gray60", 20 | linetype = 2, 21 | linesize = 1, 22 | arrowsize = 1, 23 | digits = 3, 24 | depM = FALSE, 25 | ... 26 | ) 27 | } 28 | \arguments{ 29 | \item{fit}{An object of class lm} 30 | 31 | \item{xmode}{integer. 1 or 2.} 32 | 33 | \item{pred}{name of predictor variable} 34 | 35 | \item{modx}{name of moderator variable} 36 | 37 | \item{pred.values}{Values of predictor variables} 38 | 39 | \item{modx.values}{Values of modifier variables} 40 | 41 | \item{labels}{labels of regression lines} 42 | 43 | \item{mode}{integer. one of 1:3.} 44 | 45 | \item{rangemode}{integer. 1 or 2} 46 | 47 | \item{ypos}{integer. label y position.} 48 | 49 | \item{hjust}{hjust of label} 50 | 51 | \item{linecolor}{name of color of vline and hline} 52 | 53 | \item{linetype}{linetype of arrow} 54 | 55 | \item{linesize}{size of regression line} 56 | 57 | \item{arrowsize}{size of arrow} 58 | 59 | \item{digits}{integer indicating the number of decimal places} 60 | 61 | \item{depM}{logical If true, label M instead of X} 62 | 63 | \item{...}{further arguments to be passed to add_lines} 64 | } 65 | \description{ 66 | Draw conditional effect plot 67 | } 68 | \examples{ 69 | fit=lm(justify~frame*skeptic,data=disaster) 70 | condPlot(fit,rangemode=2,xpos=0.7,labels=c("Climate change(X=1)","Natural causes(X=0)")) 71 | \donttest{ 72 | condPlot(fit,mode=2,xpos=0.6) 73 | condPlot(fit,mode=3,rangemode=2,xpos=0.5) 74 | condPlot(fit,xmode=2) 75 | condPlot(fit,xmode=2,mode=2) 76 | condPlot(fit,xmode=2,mode=3) 77 | fit=lm(mpg~vs*hp,data=mtcars) 78 | condPlot(fit,rangemode=2,xpos=0.6) 79 | condPlot(fit,mode=2,xpos=0.5) 80 | condPlot(fit,mode=3,rangemode=2) 81 | fit=lm(govact~negemot*age+posemot+ideology+sex,data=glbwarm) 82 | condPlot(fit,xmode=2,hjust=c(-0.1,-0.1,1.1)) 83 | condPlot(fit,xmode=2,pred.values=c(30,70),hjust=c(-0.1,-0.1,1.1),xpos=0.5) 84 | condPlot(fit,xmode=2,mode=2,pred.values=c(30,50,70),xpos=0.2) 85 | condPlot(fit,xmode=2,mode=3,xpos=0.5,hjust=c(-0.1,-0.1,1.1)) 86 | condPlot(fit,xmode=2,modx.values=c(2,3,4),mode=3,xpos=0.6) 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /man/condPlot2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot2.R 3 | \name{condPlot2} 4 | \alias{condPlot2} 5 | \title{Draw conditional plot for moderated moderation} 6 | \usage{ 7 | condPlot2( 8 | fit, 9 | pred = NULL, 10 | modx = NULL, 11 | mod2 = NULL, 12 | mod2.values = NULL, 13 | rangemode = 1, 14 | vjust = NULL, 15 | digits = 3, 16 | addlabel = TRUE, 17 | xvar = "Z", 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{fit}{An object of class lm} 23 | 24 | \item{pred}{name of the predictor variable} 25 | 26 | \item{modx}{name of the moderator variable} 27 | 28 | \item{mod2}{name of the second moderator variable} 29 | 30 | \item{mod2.values}{values of moderator variable} 31 | 32 | \item{rangemode}{integer. 1 or 2} 33 | 34 | \item{vjust}{integer} 35 | 36 | \item{digits}{integer indicating the number of decimal places} 37 | 38 | \item{addlabel}{logical} 39 | 40 | \item{xvar}{character. "Z" or "W"} 41 | 42 | \item{...}{Further arguments to be passed to predict3d::ggPredict()} 43 | } 44 | \description{ 45 | Draw conditional plot for moderated moderation 46 | } 47 | \examples{ 48 | fit=lm(govact~negemot*sex*age+posemot+ideology,data=glbwarm) 49 | \dontrun{ 50 | condPlot2(fit) 51 | condPlot2(fit,mod2.values = c(30,50,70)) 52 | fit1=lm(govact~negemot*age*sex+posemot+ideology,data=glbwarm) 53 | condPlot2(fit1,pred="negemot",modx="sex",mod2="age",mod2.values = c(30,50,70),xvar="W") 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /man/condPlotCat2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat2.R 3 | \name{condPlotCat2} 4 | \alias{condPlotCat2} 5 | \title{Draw direct and indirect effect plot} 6 | \usage{ 7 | condPlotCat2( 8 | labels = NULL, 9 | data = NULL, 10 | semfit, 11 | catlabels = NULL, 12 | digits = 3, 13 | add.point = FALSE, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{labels}{list of variable labels} 19 | 20 | \item{data}{data.frame} 21 | 22 | \item{semfit}{An object of class lavaan} 23 | 24 | \item{catlabels}{labels for direct/indirect effects} 25 | 26 | \item{digits}{Integer indicating the number of decimal places} 27 | 28 | \item{add.point}{logical. Whether or not add points to the plot} 29 | 30 | \item{...}{further arguments to be passed to predict3d::add_lines()} 31 | } 32 | \description{ 33 | Draw direct and indirect effect plot 34 | } 35 | \examples{ 36 | library(lavaan) 37 | labels=list(X="protest",W="sexism",M="respappr",Y="liking") 38 | moderator=list(name="sexism",site=list(c("a","c"))) 39 | data1=addCatVars(protest,"protest",mode=3) 40 | catlabels=c("Indirect: Protest\n vs. No Protest", 41 | "Indirect: Collective\n vs. Individual", 42 | "Direct: Protest\n vs. No Protest", 43 | "Direct: Collective\n vs. Individual") 44 | model=catMediation(X="protest",M="respappr",Y="liking",moderator=moderator, 45 | data=data1,maxylev=6,rangemode = 2) 46 | semfit=sem(model=model,data=data1) 47 | condPlotCat2(labels=labels,data=data1,semfit=semfit,catlabels=catlabels, 48 | xpos=c(0.7,0.3,0.3,0.7),add.point=TRUE) 49 | } 50 | -------------------------------------------------------------------------------- /man/conditionalEffectPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conditionalEffectPlot.R 3 | \name{conditionalEffectPlot} 4 | \alias{conditionalEffectPlot} 5 | \title{Make conditional effect plot} 6 | \usage{ 7 | conditionalEffectPlot( 8 | semfit, 9 | values = NULL, 10 | data, 11 | no = 1, 12 | mod = NULL, 13 | color = c("black", "red"), 14 | lty = c(1, 3), 15 | linesize = 1 16 | ) 17 | } 18 | \arguments{ 19 | \item{semfit}{An object of class lavaan} 20 | 21 | \item{values}{Optional value} 22 | 23 | \item{data}{A data.frame} 24 | 25 | \item{no}{Integer} 26 | 27 | \item{mod}{Name of moderator variable} 28 | 29 | \item{color}{character vector line color} 30 | 31 | \item{lty}{numeric line type} 32 | 33 | \item{linesize}{numeric linesize} 34 | } 35 | \description{ 36 | Make conditional effect plot 37 | } 38 | -------------------------------------------------------------------------------- /man/convertPvalue.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{convertPvalue} 4 | \alias{convertPvalue} 5 | \title{convert vector of p values to string} 6 | \usage{ 7 | convertPvalue(x) 8 | } 9 | \arguments{ 10 | \item{x}{vector of p values} 11 | } 12 | \description{ 13 | convert vector of p values to string 14 | } 15 | -------------------------------------------------------------------------------- /man/corPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{corPlot} 4 | \alias{corPlot} 5 | \title{Draw correlation plot} 6 | \usage{ 7 | corPlot( 8 | fit, 9 | label = 2, 10 | yreverse = TRUE, 11 | xangle = 45, 12 | seek = NULL, 13 | replace = NULL, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 19 | 20 | \item{label}{if 0, no label(default), if 1, use r value as label, if 2, use r value with significant mark as label} 21 | 22 | \item{yreverse}{Logical. if true, reverse the order of y axis.} 23 | 24 | \item{xangle}{axis.x.text.angle} 25 | 26 | \item{seek}{string to look for} 27 | 28 | \item{replace}{A string of replacement} 29 | 30 | \item{...}{Further arguments to be passed on to geom_text} 31 | } 32 | \value{ 33 | A ggplot 34 | } 35 | \description{ 36 | Draw correlation plot 37 | } 38 | -------------------------------------------------------------------------------- /man/corTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{corTable} 4 | \alias{corTable} 5 | \title{Make a table with correlation} 6 | \usage{ 7 | corTable(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | } 12 | \description{ 13 | Make a table with correlation 14 | } 15 | -------------------------------------------------------------------------------- /man/corTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{corTable2} 4 | \alias{corTable2} 5 | \title{Make a table with correlation} 6 | \usage{ 7 | corTable2(fit, vanilla = TRUE, addFooter = FALSE, seek = NULL, replace = NULL) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | 12 | \item{vanilla}{Logical. If true, vanilla.table is returned} 13 | 14 | \item{addFooter}{Logical. If true, footer added} 15 | 16 | \item{seek}{string to look for} 17 | 18 | \item{replace}{A string of replacement} 19 | } 20 | \description{ 21 | Make a table with correlation 22 | } 23 | -------------------------------------------------------------------------------- /man/countM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{countM} 4 | \alias{countM} 5 | \title{Count the group names start with "M"} 6 | \usage{ 7 | countM(group) 8 | } 9 | \arguments{ 10 | \item{group}{A string vectors} 11 | } 12 | \description{ 13 | Count the group names start with "M" 14 | } 15 | -------------------------------------------------------------------------------- /man/covar2df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawConcept.R 3 | \name{covar2df} 4 | \alias{covar2df} 5 | \title{Make data.frame with covariates} 6 | \usage{ 7 | covar2df(covar = list(), df) 8 | } 9 | \arguments{ 10 | \item{covar}{A list} 11 | 12 | \item{df}{A data.frame} 13 | } 14 | \description{ 15 | Make data.frame with covariates 16 | } 17 | -------------------------------------------------------------------------------- /man/deleteSingleNumber.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{deleteSingleNumber} 4 | \alias{deleteSingleNumber} 5 | \title{remove coefficient number of equation} 6 | \usage{ 7 | deleteSingleNumber(equation) 8 | } 9 | \arguments{ 10 | \item{equation}{string} 11 | } 12 | \description{ 13 | remove coefficient number of equation 14 | } 15 | -------------------------------------------------------------------------------- /man/densityPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/densityPlot.R 3 | \name{densityPlot} 4 | \alias{densityPlot} 5 | \title{Draw Smoothed Kernel density plot} 6 | \usage{ 7 | densityPlot( 8 | x, 9 | sig = 0.05, 10 | digits = 3, 11 | xlab = "Indirect effect(ab)", 12 | ylab = NULL 13 | ) 14 | } 15 | \arguments{ 16 | \item{x}{A numeric vector} 17 | 18 | \item{sig}{significant level. Default value is 0.05} 19 | 20 | \item{digits}{Integer indicating the number of decimal places} 21 | 22 | \item{xlab}{character. x axis label} 23 | 24 | \item{ylab}{character. y axis label} 25 | } 26 | \description{ 27 | Draw Smoothed Kernel density plot 28 | } 29 | \examples{ 30 | require(lavaan) 31 | labels=list(X="cond",M="pmi",Y="reaction") 32 | model=tripleEquation(labels=labels) 33 | \donttest{ 34 | set.seed(1234) 35 | semfit=sem(model,data=pmi,se="boot",bootstrap=100) 36 | bootData=getBootData(semfit) 37 | bootData$indirect=bootData$a*bootData$b 38 | densityPlot(bootData$indirect) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /man/disaster.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{disaster} 5 | \alias{disaster} 6 | \title{Disaster dataset} 7 | \format{ 8 | A data.frame with 211 obs. of 5 variables 9 | \describe{ 10 | \item{id}{id} 11 | \item{frame}{Experimental condition. 0 = naturally caused disaster, 1 = climate change caused disaster} 12 | \item{donate}{Positive attitudes toward donating} 13 | \item{justify}{Negative justifications} 14 | \item{skeptic}{Climate change skepticism} 15 | } 16 | } 17 | \source{ 18 | Chapman, D. A., & Little, B. (2016). Climate change and disasters: How framing affects justifications for giving or withholding aid to disaster victims. Social Psychological and Personality Science, 7, 13-20. 19 | 20 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 21 | } 22 | \usage{ 23 | disaster 24 | } 25 | \description{ 26 | Disaster dataset 27 | } 28 | \keyword{datasets} 29 | -------------------------------------------------------------------------------- /man/discriminantValidityTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{discriminantValidityTable} 4 | \alias{discriminantValidityTable} 5 | \title{make discriminant Validity Table} 6 | \usage{ 7 | discriminantValidityTable(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of a class lavaan} 11 | } 12 | \description{ 13 | make discriminant Validity Table 14 | } 15 | -------------------------------------------------------------------------------- /man/discriminantValidityTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{discriminantValidityTable2} 4 | \alias{discriminantValidityTable2} 5 | \title{make discriminant Validity Table in flextable format} 6 | \usage{ 7 | discriminantValidityTable2(fit, vanilla = FALSE) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of a class lavaan} 11 | 12 | \item{vanilla}{Logical} 13 | } 14 | \description{ 15 | make discriminant Validity Table in flextable format 16 | } 17 | -------------------------------------------------------------------------------- /man/divideEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/catMediation.R 3 | \name{divideEquation} 4 | \alias{divideEquation} 5 | \title{divide equation} 6 | \usage{ 7 | divideEquation(equation) 8 | } 9 | \arguments{ 10 | \item{equation}{a string} 11 | } 12 | \description{ 13 | divide equation 14 | } 15 | \examples{ 16 | equation="(a1+a3*W)*(b)" 17 | divideEquation(equation) 18 | } 19 | -------------------------------------------------------------------------------- /man/drawArrows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{drawArrows} 4 | \alias{drawArrows} 5 | \title{Draw arrows} 6 | \usage{ 7 | drawArrows( 8 | arrows, 9 | nodes, 10 | xmargin = 0.01, 11 | radx = 0.1, 12 | rady = 0.04, 13 | addprime = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{arrows}{A data.frame} 18 | 19 | \item{nodes}{A data.frame} 20 | 21 | \item{xmargin}{horizontal margin of plot} 22 | 23 | \item{radx}{horizontal radius of the box.} 24 | 25 | \item{rady}{vertical radius of the box.} 26 | 27 | \item{addprime}{logical Whether add prime to label "c"} 28 | } 29 | \description{ 30 | Draw arrows 31 | } 32 | -------------------------------------------------------------------------------- /man/drawCatModel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawCatModel.R 3 | \name{drawCatModel} 4 | \alias{drawCatModel} 5 | \title{Draw statistical diagram including categorical X} 6 | \usage{ 7 | drawCatModel( 8 | xcount = 3, 9 | M = NULL, 10 | W = NULL, 11 | whatLabel = "name", 12 | addDots = TRUE, 13 | xmargin = 0.01, 14 | radx = 0.08, 15 | ymargin = 0.02, 16 | xlim = c(-0.2, 1.2), 17 | ylim = xlim, 18 | rady = 0.04, 19 | maxypos = 0.6, 20 | minypos = 0.2, 21 | ypos = c(1, 0.5), 22 | mpos = c(0.5, 0.9), 23 | xinterval = NULL, 24 | yinterval = NULL, 25 | box.col = "white", 26 | xspace = NULL, 27 | label.pos = list() 28 | ) 29 | } 30 | \arguments{ 31 | \item{xcount}{integer length of categorical variables} 32 | 33 | \item{M}{character name of mediator variable} 34 | 35 | \item{W}{character name of moderator variable} 36 | 37 | \item{whatLabel}{What should the edge labels indicate in the path diagram? Choices are c("est","name")} 38 | 39 | \item{addDots}{logical.} 40 | 41 | \item{xmargin}{horizontal margin between nodes} 42 | 43 | \item{radx}{horizontal radius of the box.} 44 | 45 | \item{ymargin}{vertical margin between nodes} 46 | 47 | \item{xlim}{the x limits (min,max) of the plot} 48 | 49 | \item{ylim}{the y limits (min,max) of the plot} 50 | 51 | \item{rady}{vertical radius of the box.} 52 | 53 | \item{maxypos}{maximal y position of X or W variables} 54 | 55 | \item{minypos}{minimal y position of X or W variables} 56 | 57 | \item{ypos}{The x and y position of Y node. Default value is c(1,0.5)} 58 | 59 | \item{mpos}{The x and y position of M node. Default value is c(0.5,0.9)} 60 | 61 | \item{xinterval}{numeric. Horizontal intervals among labels for nodes and nodes} 62 | 63 | \item{yinterval}{numeric. Vertical intervals among labels for nodes and nodes} 64 | 65 | \item{box.col}{fill color of the box} 66 | 67 | \item{xspace}{numeric. Horizontal distance between nodes} 68 | 69 | \item{label.pos}{Optional list of arrow label position} 70 | } 71 | \description{ 72 | Draw statistical diagram including categorical X 73 | } 74 | \examples{ 75 | drawCatModel(xcount=4) 76 | drawCatModel(M="M",box.col="yellow") 77 | drawCatModel(W="W",xlim=c(-0.08,1),ylim=c(0.13,0.95),ypos=c(1,0.55)) 78 | drawCatModel(M="M",W="W",xlim=c(-0.08,1),ylim=c(0.13,0.95),ypos=c(1,0.55)) 79 | drawCatModel(xcount=4,M="M",W="W",xlim=c(-0.08,1),ylim=c(0.13,0.95),ypos=c(1,0.55)) 80 | } 81 | -------------------------------------------------------------------------------- /man/drawCovar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{drawCovar} 4 | \alias{drawCovar} 5 | \title{Draw covariate} 6 | \usage{ 7 | drawCovar(covar = list(), x, y, m, radx = 0.1, rady = 0.06, yinterval = 0.02) 8 | } 9 | \arguments{ 10 | \item{covar}{A list} 11 | 12 | \item{x}{position of x} 13 | 14 | \item{y}{position of y} 15 | 16 | \item{m}{position of m} 17 | 18 | \item{radx}{horizontal radius of the box.} 19 | 20 | \item{rady}{vertical radius of the box.} 21 | 22 | \item{yinterval}{vertical interval between box} 23 | } 24 | \description{ 25 | Draw covariate 26 | } 27 | -------------------------------------------------------------------------------- /man/drawStatDiagram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{drawStatDiagram} 4 | \alias{drawStatDiagram} 5 | \title{draw StatDiagram} 6 | \usage{ 7 | drawStatDiagram( 8 | no, 9 | arrows, 10 | nodes, 11 | labels, 12 | nodeslabels = list(), 13 | xmargin, 14 | radx, 15 | rady, 16 | fit = NULL, 17 | addprime = TRUE, 18 | box.col = "white", 19 | xlim = c(0, 1), 20 | ylim = c(0, 1) 21 | ) 22 | } 23 | \arguments{ 24 | \item{no}{process macro model number} 25 | 26 | \item{arrows}{A data.frame} 27 | 28 | \item{nodes}{A data.frame} 29 | 30 | \item{labels}{A list} 31 | 32 | \item{nodeslabels}{A list} 33 | 34 | \item{xmargin}{horizontal margin of plot} 35 | 36 | \item{radx}{horizontal radius of the box.} 37 | 38 | \item{rady}{vertical radius of the box.} 39 | 40 | \item{fit}{An object of class lavaan. Result of lavaan::sem()} 41 | 42 | \item{addprime}{logical Whether add prime to label "c"} 43 | 44 | \item{box.col}{fill color of the box} 45 | 46 | \item{xlim}{the x limits (min,max) of the plot} 47 | 48 | \item{ylim}{the y limits (min,max) of the plot} 49 | } 50 | \description{ 51 | draw StatDiagram 52 | } 53 | -------------------------------------------------------------------------------- /man/drawtext.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{drawtext} 4 | \alias{drawtext} 5 | \title{Draw node} 6 | \usage{ 7 | drawtext(..., latent = TRUE) 8 | } 9 | \arguments{ 10 | \item{...}{Further argument to be passed to textellipse() or textrect()} 11 | 12 | \item{latent}{Logical} 13 | } 14 | \description{ 15 | Draw node 16 | } 17 | -------------------------------------------------------------------------------- /man/education.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{education} 5 | \alias{education} 6 | \title{Data Set for education and income} 7 | \format{ 8 | A data.frame with 850 rows and 4 variables: 9 | \describe{ 10 | \item{age}{student age} 11 | \item{number}{number of students per class} 12 | \item{duration}{eduation duration} 13 | \item{income}{income} 14 | } 15 | } 16 | \usage{ 17 | education 18 | } 19 | \description{ 20 | A dataset contains measures about the teacher's knowledge, empathy and intervention about attention-deficit hyperactivity disorder(ADHD). 21 | } 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/eq2df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/catMediation.R 3 | \name{eq2df} 4 | \alias{eq2df} 5 | \title{Convert equation to data.frame} 6 | \usage{ 7 | eq2df(eq) 8 | } 9 | \arguments{ 10 | \item{eq}{equation separated by linefeed} 11 | } 12 | \description{ 13 | Convert equation to data.frame 14 | } 15 | -------------------------------------------------------------------------------- /man/eq2fit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/regEquation.R 3 | \name{eq2fit} 4 | \alias{eq2fit} 5 | \title{Make a list of objects of class lm} 6 | \usage{ 7 | eq2fit(equations, data) 8 | } 9 | \arguments{ 10 | \item{equations}{equations for linear regression} 11 | 12 | \item{data}{A data.frame} 13 | } 14 | \value{ 15 | a list of objects of class lm 16 | } 17 | \description{ 18 | Make a list of objects of class lm 19 | } 20 | -------------------------------------------------------------------------------- /man/eq2var.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/labels2table.R 3 | \name{eq2var} 4 | \alias{eq2var} 5 | \title{make data.frame with equation} 6 | \usage{ 7 | eq2var(eq, labels = list()) 8 | } 9 | \arguments{ 10 | \item{eq}{equation} 11 | 12 | \item{labels}{A list} 13 | } 14 | \description{ 15 | make data.frame with equation 16 | } 17 | \examples{ 18 | labels=list(X="frame",M="justify",Y="donate",W="skeptic") 19 | eq="donate~justify+frame+skeptic+frame:skeptic" 20 | eq2var(eq,labels=labels) 21 | eq="Y~M+W+M:W+X+X:W" 22 | labels=list(X="X",M="M",Y="Y") 23 | eq2var(eq,labels=labels) 24 | eq="wine~baby+milk+baby:milk" 25 | labels=list(X="baby",M=c("wine","tent","sand"),Y="tile",W="milk") 26 | eq2var(eq,labels=labels) 27 | eq="M3~X" 28 | eq="Y~M1+M2+X" 29 | labels=list(X="X",M=c("M1","M2"),Y="Y") 30 | eq2var(eq,labels=labels) 31 | } 32 | -------------------------------------------------------------------------------- /man/equations2var.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/labels2table.R 3 | \name{equations2var} 4 | \alias{equations2var} 5 | \title{make data.frame with equation} 6 | \usage{ 7 | equations2var(eq, labels = list()) 8 | } 9 | \arguments{ 10 | \item{eq}{equation} 11 | 12 | \item{labels}{A list} 13 | } 14 | \description{ 15 | make data.frame with equation 16 | } 17 | \examples{ 18 | labels=list(X="frame",M="justify",Y="donate",W="skeptic") 19 | moderator=list(name="skeptic",site=list(c("a","c"))) 20 | eq=multipleMediation(labels=labels,moderator=moderator,mode=1) 21 | covar=list(name=c("C1","C2","C3"),site=list(c("M","Y"),c("M","Y"),c("M","Y"))) 22 | eq=multipleMediation(labels=labels,covar=covar,mode=1) 23 | equations2var(eq,labels=labels) 24 | } 25 | -------------------------------------------------------------------------------- /man/est2Arrows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{est2Arrows} 4 | \alias{est2Arrows} 5 | \title{Make arrows from estimatesTable} 6 | \usage{ 7 | est2Arrows(res) 8 | } 9 | \arguments{ 10 | \item{res}{A data.frame, result of estimatesTable} 11 | } 12 | \description{ 13 | Make arrows from estimatesTable 14 | } 15 | -------------------------------------------------------------------------------- /man/est2Nodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{est2Nodes} 4 | \alias{est2Nodes} 5 | \title{Make nodes from estimatesTable} 6 | \usage{ 7 | est2Nodes(res, lastxno = 2) 8 | } 9 | \arguments{ 10 | \item{res}{A data.frame, result of estimatesTable} 11 | 12 | \item{lastxno}{A numeric} 13 | } 14 | \description{ 15 | Make nodes from estimatesTable 16 | } 17 | -------------------------------------------------------------------------------- /man/estimatesTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{estimatesTable} 4 | \alias{estimatesTable} 5 | \title{convert parameterEstimates to data.frame} 6 | \usage{ 7 | estimatesTable( 8 | fit, 9 | latent = TRUE, 10 | regression = TRUE, 11 | mediation = FALSE, 12 | covar = FALSE, 13 | ci = FALSE, 14 | standardized = TRUE, 15 | digits = 2 16 | ) 17 | } 18 | \arguments{ 19 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 20 | 21 | \item{latent}{whether the latent variables be included in result} 22 | 23 | \item{regression}{whether the regressions be included in result} 24 | 25 | \item{mediation}{whether the mediation effects be included in result} 26 | 27 | \item{covar}{whether the covariances be included in result} 28 | 29 | \item{ci}{If TRUE, confidence intervals are added to the output} 30 | 31 | \item{standardized}{Logical. If TRUE, standardized estimates are added to the output} 32 | 33 | \item{digits}{integer indicating the number of decimal places to be used.} 34 | } 35 | \description{ 36 | convert parameterEstimates to data.frame 37 | } 38 | -------------------------------------------------------------------------------- /man/estimatesTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{estimatesTable2} 4 | \alias{estimatesTable2} 5 | \title{convert parameterEstimates to flextable} 6 | \usage{ 7 | estimatesTable2( 8 | fit, 9 | vanilla = TRUE, 10 | digits = 3, 11 | seek = NULL, 12 | replace = NULL, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 18 | 19 | \item{vanilla}{Logical} 20 | 21 | \item{digits}{integer indicating the number of decimal places to be used.} 22 | 23 | \item{seek}{string to look for} 24 | 25 | \item{replace}{A string of replacement} 26 | 27 | \item{...}{Further arguments to be passed to estimatesTable()} 28 | } 29 | \description{ 30 | convert parameterEstimates to flextable 31 | } 32 | -------------------------------------------------------------------------------- /man/estress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{estress} 5 | \alias{estress} 6 | \title{ESTRESS: Economic stress dataset} 7 | \format{ 8 | A data.frame with 262 obs. of 7 variables 9 | \describe{ 10 | \item{tenure}{Company Tenure} 11 | \item{estress}{Economic stress} 12 | \item{affect}{Depressed affect} 13 | \item{withdraw}{Withdrawal intentions} 14 | \item{sex}{Male (1) or Female (0)} 15 | \item{age}{age} 16 | \item{ese}{Entrepreneurial self efficacy} 17 | } 18 | } 19 | \source{ 20 | Pollack, J., VanEpps, E. M., & Hayes, A. F. (2012). The moderating role of social ties on entrepreneurs' depressed affect and withdrawal intentions in response to economic stress. Journal of Organizational Behavior, 33, 789-810. 21 | 22 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 23 | } 24 | \usage{ 25 | estress 26 | } 27 | \description{ 28 | ESTRESS: Economic stress dataset 29 | } 30 | \keyword{datasets} 31 | -------------------------------------------------------------------------------- /man/extractIMM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/extractIMM.R 3 | \name{extractIMM} 4 | \alias{extractIMM} 5 | \title{extract index of moderated mediation from string} 6 | \usage{ 7 | extractIMM(string) 8 | } 9 | \arguments{ 10 | \item{string}{A string} 11 | } 12 | \description{ 13 | extract index of moderated mediation from string 14 | } 15 | \examples{ 16 | string="(a1+a3*age.mean)*(b1+b3*age.mean)" 17 | string="(a1+a3*skeptic.mean)*(b1+b2*skeptic.mean+b4*Z.mean)" 18 | string="(a1+a3*age.mean)*(b)" 19 | string="(a1+a3*4.12)*(b)" 20 | string="(a)*(b)" 21 | extractIMM(string) 22 | } 23 | -------------------------------------------------------------------------------- /man/extractLatentVar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{extractLatentVar} 4 | \alias{extractLatentVar} 5 | \title{Extract Latent Variables Data} 6 | \usage{ 7 | extractLatentVar(fit, labels) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of lavaan::sem()} 11 | 12 | \item{labels}{A list} 13 | } 14 | \description{ 15 | Extract Latent Variables Data 16 | } 17 | -------------------------------------------------------------------------------- /man/extractLatentVarName.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{extractLatentVarName} 4 | \alias{extractLatentVarName} 5 | \title{Extract Latent Variables Names} 6 | \usage{ 7 | extractLatentVarName(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of lavaan::sem()} 11 | } 12 | \description{ 13 | Extract Latent Variables Names 14 | } 15 | -------------------------------------------------------------------------------- /man/extractModerator.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/extractIMM.R 3 | \name{extractModerator} 4 | \alias{extractModerator} 5 | \title{Extract name of moderator from string} 6 | \usage{ 7 | extractModerator(string) 8 | } 9 | \arguments{ 10 | \item{string}{A string} 11 | } 12 | \description{ 13 | Extract name of moderator from string 14 | } 15 | \examples{ 16 | string="(a1+a3*age.mean)*(b1+b3*age.mean)" 17 | string="(a1+a3*age.mean)*(b)" 18 | string="(a1+a3*4.12)*(b)" 19 | string="(a)*(b)" 20 | extractNumber(string) 21 | extractModerator(string) 22 | } 23 | -------------------------------------------------------------------------------- /man/extractNumber.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{extractNumber} 4 | \alias{extractNumber} 5 | \title{extract number from string} 6 | \usage{ 7 | extractNumber(x) 8 | } 9 | \arguments{ 10 | \item{x}{a string} 11 | } 12 | \description{ 13 | extract number from string 14 | } 15 | -------------------------------------------------------------------------------- /man/extractRange.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{extractRange} 4 | \alias{extractRange} 5 | \title{Extract range from a data.frame} 6 | \usage{ 7 | extractRange(res, mod, what = "indirect") 8 | } 9 | \arguments{ 10 | \item{res}{A data.frame} 11 | 12 | \item{mod}{Name of moderator} 13 | 14 | \item{what}{string} 15 | } 16 | \description{ 17 | Extract range from a data.frame 18 | } 19 | -------------------------------------------------------------------------------- /man/extractX.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{extractX} 4 | \alias{extractX} 5 | \title{Extract group by string} 6 | \usage{ 7 | extractX(string, groupby = "X") 8 | } 9 | \arguments{ 10 | \item{string}{character vector} 11 | 12 | \item{groupby}{name of groupby} 13 | } 14 | \description{ 15 | Extract group by string 16 | } 17 | -------------------------------------------------------------------------------- /man/findName.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{findName} 4 | \alias{findName} 5 | \title{convert name with list} 6 | \usage{ 7 | findName(labels, nodeslabels = list(), name = "MiX", exact = FALSE) 8 | } 9 | \arguments{ 10 | \item{labels}{A named list} 11 | 12 | \item{nodeslabels}{A named list} 13 | 14 | \item{name}{A name to look for} 15 | 16 | \item{exact}{A logical} 17 | } 18 | \description{ 19 | convert name with list 20 | } 21 | \examples{ 22 | labels=list(X="wt",M="am",Y="mpg");name="MiX" 23 | nodeslabels=list(X="weight",M="automatic",Y="milepergallon") 24 | findName(labels=labels,nodeslabels=nodeslabels,name="MiX") 25 | findName(labels=labels,name="MiX") 26 | findName(labels=labels,nodeslabels=nodeslabels,name="M") 27 | labels=list(X="GDPpp",M="Illit",Y="LifeEx") 28 | nodeslabels=list(X="GDP\nper inhabitant",M="Illiteracy Rate",Y="Mean Life\nExpectation") 29 | findName(labels=labels,name="Mi") 30 | findName(labels=labels,nodeslabels=nodeslabels,name="Mi") 31 | labels=list(X="GDPpp",Mi="Illit",Y="LifeEx") 32 | nodeslabels=list(X="GDP\nper inhabitant",Mi="Illiteracy Rate",Y="Mean Life\nExpectation") 33 | findName(labels=labels,name="M") 34 | findName(labels=labels,nodeslabels=nodeslabels,name="M") 35 | labels=list(X="cond",M=c("import","pmi"),Y="reaction") 36 | findName(labels=labels,name="M1") 37 | } 38 | -------------------------------------------------------------------------------- /man/findNames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{findNames} 4 | \alias{findNames} 5 | \title{convert a vector of names with list} 6 | \usage{ 7 | findNames(labels, nodeslabels = list(), names, exact = FALSE) 8 | } 9 | \arguments{ 10 | \item{labels}{A named list} 11 | 12 | \item{nodeslabels}{A named list} 13 | 14 | \item{names}{A character vector to look for} 15 | 16 | \item{exact}{A logical} 17 | } 18 | \description{ 19 | convert a vector of names with list 20 | } 21 | \examples{ 22 | labels=list(X="wt",Mi="am",Y="mpg");names=c("X","MiX","Y") 23 | findNames(labels,names=names) 24 | } 25 | -------------------------------------------------------------------------------- /man/fit2alpha.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{fit2alpha} 4 | \alias{fit2alpha} 5 | \title{Make a Cronbach alpha table} 6 | \usage{ 7 | fit2alpha(fit, digits = 3) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | 12 | \item{digits}{integer indicating the number of decimal places to be used.} 13 | } 14 | \description{ 15 | Make a Cronbach alpha table 16 | } 17 | -------------------------------------------------------------------------------- /man/fit2df2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{fit2df2} 4 | \alias{fit2df2} 5 | \title{Make a data.frame for conceptDiagram} 6 | \usage{ 7 | fit2df2(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | } 12 | \description{ 13 | Make a data.frame for conceptDiagram 14 | } 15 | -------------------------------------------------------------------------------- /man/fit2table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{fit2table} 4 | \alias{fit2table} 5 | \title{Make estimatesTable with a list of lm object} 6 | \usage{ 7 | fit2table(fit, labels = labels, digits = 3) 8 | } 9 | \arguments{ 10 | \item{fit}{A list of lm object} 11 | 12 | \item{labels}{A list} 13 | 14 | \item{digits}{integer indicating the number of decimal places} 15 | } 16 | \description{ 17 | Make estimatesTable with a list of lm object 18 | } 19 | \examples{ 20 | labels=list(X="frame",M="justify",Y="donate",W="skeptic") 21 | moderator=list(name="skeptic",site=list(c("a","c"))) 22 | eq=tripleEquation(labels=labels,moderator=moderator,data=disaster,mode=1) 23 | fit=eq2fit(eq,data=disaster) 24 | fit2table(fit=fit,labels=labels) 25 | } 26 | -------------------------------------------------------------------------------- /man/fit2vif.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{fit2vif} 4 | \alias{fit2vif} 5 | \title{Summarizing correlation, tolerance and variance inflation factors of a model} 6 | \usage{ 7 | fit2vif(fit, mode = 1, namemode = 1, digits = 3) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lm} 11 | 12 | \item{mode}{integer. one of 1:2} 13 | 14 | \item{namemode}{integer. One of 1:3} 15 | 16 | \item{digits}{logical} 17 | } 18 | \description{ 19 | Summarizing correlation, tolerance and variance inflation factors of a model 20 | } 21 | \examples{ 22 | fit=lm(govact~negemot*age,data=glbwarm) 23 | fit2vif(fit) 24 | } 25 | -------------------------------------------------------------------------------- /man/fun2eq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conditionalEffectPlot.R 3 | \name{fun2eq} 4 | \alias{fun2eq} 5 | \title{Make equation from function} 6 | \usage{ 7 | fun2eq(fun) 8 | } 9 | \arguments{ 10 | \item{fun}{A function} 11 | } 12 | \description{ 13 | Make equation from function 14 | } 15 | -------------------------------------------------------------------------------- /man/get2ndIndirect.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{get2ndIndirect} 4 | \alias{get2ndIndirect} 5 | \title{get2ndIndirect effect} 6 | \usage{ 7 | get2ndIndirect(X = NULL, M = NULL, Y = NULL, labels = list()) 8 | } 9 | \arguments{ 10 | \item{X}{Names of independent variable} 11 | 12 | \item{M}{Names of mediator variable} 13 | 14 | \item{Y}{Names of dependent variable} 15 | 16 | \item{labels}{A list} 17 | } 18 | \description{ 19 | get2ndIndirect effect 20 | } 21 | \examples{ 22 | get2ndIndirect(X="X",M=c("M1","M2","M3")) 23 | } 24 | -------------------------------------------------------------------------------- /man/getArrows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{getArrows} 4 | \alias{getArrows} 5 | \title{Get arrows data with no} 6 | \usage{ 7 | getArrows(no = 25) 8 | } 9 | \arguments{ 10 | \item{no}{model number} 11 | } 12 | \description{ 13 | Get arrows data with no 14 | } 15 | -------------------------------------------------------------------------------- /man/getAspectRatio.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conditionalEffectPlot.R 3 | \name{getAspectRatio} 4 | \alias{getAspectRatio} 5 | \title{Get aspect information of a ggplot} 6 | \usage{ 7 | getAspectRatio(p) 8 | } 9 | \arguments{ 10 | \item{p}{A ggplot object} 11 | } 12 | \description{ 13 | Get aspect information of a ggplot 14 | } 15 | -------------------------------------------------------------------------------- /man/getBootData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/densityPlot.R 3 | \name{getBootData} 4 | \alias{getBootData} 5 | \title{Get bootstrapped values} 6 | \usage{ 7 | getBootData(semfit, what = "coef.boot", ...) 8 | } 9 | \arguments{ 10 | \item{semfit}{An object of class lavaan} 11 | 12 | \item{what}{Character. What needs to be inspected/extracted?} 13 | 14 | \item{...}{Further argument to be passed to lavaan::lavTech()} 15 | } 16 | \description{ 17 | Get bootstrapped values 18 | } 19 | \examples{ 20 | require(lavaan) 21 | labels=list(X="cond",M="pmi",Y="reaction") 22 | model=tripleEquation(labels=labels) 23 | \donttest{ 24 | set.seed(1234) 25 | semfit=sem(model,data=pmi,se="boot",bootstrap=100) 26 | getBootData(semfit) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /man/getCatSlopeDf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat.R 3 | \name{getCatSlopeDf} 4 | \alias{getCatSlopeDf} 5 | \title{Make data summarizing regression slopes and intercepts} 6 | \usage{ 7 | getCatSlopeDf( 8 | labels = NULL, 9 | data, 10 | yvar = "Y", 11 | total = FALSE, 12 | addvars = TRUE, 13 | add.label = FALSE, 14 | maxylev = 6, 15 | mode = 1, 16 | rangemode = 2 17 | ) 18 | } 19 | \arguments{ 20 | \item{labels}{Named list of variables} 21 | 22 | \item{data}{A data.frame} 23 | 24 | \item{yvar}{Label of the dependent variable. Either "Y"(default) or "M".} 25 | 26 | \item{total}{logical. If true, model include mediator variable.} 27 | 28 | \item{addvars}{logical. Whether or not add categorical variables to the data} 29 | 30 | \item{add.label}{logical} 31 | 32 | \item{maxylev}{maximal unique length of categorical variable} 33 | 34 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 35 | 36 | \item{rangemode}{rangemode. 1 or 2.} 37 | } 38 | \description{ 39 | Make data summarizing regression slopes and intercepts 40 | } 41 | \examples{ 42 | labels=list(X="protest",W="sexism",M="respappr",Y="liking") 43 | getCatSlopeDf(labels=labels,yvar="M",data=protest,mode=3) 44 | getCatSlopeDf(labels=labels,yvar="M",data=protest,mode=1) 45 | } 46 | -------------------------------------------------------------------------------- /man/getCoef.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary2.R 3 | \name{getCoef} 4 | \alias{getCoef} 5 | \title{Get coef summary table} 6 | \usage{ 7 | getCoef(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lm} 11 | } 12 | \description{ 13 | Get coef summary table 14 | } 15 | \examples{ 16 | fit=lm(mpg~hp*wt+am,data=mtcars) 17 | getCoef(fit) 18 | } 19 | -------------------------------------------------------------------------------- /man/getEq2p.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot.R 3 | \name{getEq2p} 4 | \alias{getEq2p} 5 | \title{get slope and intercept with 2 points} 6 | \usage{ 7 | getEq2p(x1, y1, x2, y2) 8 | } 9 | \arguments{ 10 | \item{x1}{x coordinate of the first point} 11 | 12 | \item{y1}{y coordinate of the first point} 13 | 14 | \item{x2}{x coordinate of the second point} 15 | 16 | \item{y2}{y coordinate of the second point} 17 | } 18 | \description{ 19 | get slope and intercept with 2 points 20 | } 21 | -------------------------------------------------------------------------------- /man/getHelmert.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/addCatVars.R 3 | \name{getHelmert} 4 | \alias{getHelmert} 5 | \title{Get Helmert Coding of column j of group with length of unique values (count-1)} 6 | \source{ 7 | Andrew F. Hayes.(2018) Introduction to Mediation, Moderation and Conditional Process Analysis(2nd Ed.). New York, NY: The Guilford Press. p584 8 | } 9 | \usage{ 10 | getHelmert(x, j, count = NULL) 11 | } 12 | \arguments{ 13 | \item{x}{a numeric vector} 14 | 15 | \item{j}{column no} 16 | 17 | \item{count}{length unique values of group minus 1} 18 | } 19 | \value{ 20 | A numeric vector 21 | } 22 | \description{ 23 | Get Helmert Coding of column j of group with length of unique values (count-1) 24 | } 25 | \examples{ 26 | x=c(1:4,4:2,2,3,5) 27 | getHelmert(x,1) 28 | getHelmert(mtcars$cyl,1) 29 | } 30 | -------------------------------------------------------------------------------- /man/getInfo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{getInfo} 4 | \alias{getInfo} 5 | \title{Get information of a model} 6 | \usage{ 7 | getInfo(fit, digits = 3) 8 | } 9 | \arguments{ 10 | \item{fit}{object of class lm} 11 | 12 | \item{digits}{integer indicating the number of decimal places} 13 | } 14 | \description{ 15 | Get information of a model 16 | } 17 | \examples{ 18 | fit=lm(mpg~wt*hp,data=mtcars) 19 | getInfo(fit) 20 | } 21 | -------------------------------------------------------------------------------- /man/getMeanSd.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meanSummary.R 3 | \name{getMeanSd} 4 | \alias{getMeanSd} 5 | \title{get mean and sd} 6 | \usage{ 7 | getMeanSd(data, X, Y, digits) 8 | } 9 | \arguments{ 10 | \item{data}{A data.frame} 11 | 12 | \item{X}{Name of independent variable} 13 | 14 | \item{Y}{Name of dependent variable} 15 | 16 | \item{digits}{Integer indicating the number of decimal places} 17 | } 18 | \description{ 19 | get mean and sd 20 | } 21 | -------------------------------------------------------------------------------- /man/getNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{getNodes} 4 | \alias{getNodes} 5 | \title{Get nodes data with model no} 6 | \usage{ 7 | getNodes(no = 25) 8 | } 9 | \arguments{ 10 | \item{no}{model number} 11 | } 12 | \description{ 13 | Get nodes data with model no 14 | } 15 | -------------------------------------------------------------------------------- /man/getRatioTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/addCatVars.R 3 | \name{getRatioTable} 4 | \alias{getRatioTable} 5 | \title{Get coding table for dummy variables} 6 | \usage{ 7 | getRatioTable(count = 3, mode = 1) 8 | } 9 | \arguments{ 10 | \item{count}{number of unique length of categorical variable} 11 | 12 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 13 | } 14 | \description{ 15 | Get coding table for dummy variables 16 | } 17 | \examples{ 18 | getRatioTable(count=3) 19 | getRatioTable(count=4,mode=3) 20 | } 21 | -------------------------------------------------------------------------------- /man/getRepValues.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary3.R 3 | \name{getRepValues} 4 | \alias{getRepValues} 5 | \title{Get representative values} 6 | \usage{ 7 | getRepValues(data, colname, rangemode = 2, maxylev = 6, digits = digits) 8 | } 9 | \arguments{ 10 | \item{data}{A data.frame} 11 | 12 | \item{colname}{Name of column} 13 | 14 | \item{rangemode}{Integer. 1 or 2} 15 | 16 | \item{maxylev}{Integer. Maximum unique length of variable to be treated as a categorical variable} 17 | 18 | \item{digits}{integer indicating the number of decimal places} 19 | } 20 | \description{ 21 | Get representative values 22 | } 23 | -------------------------------------------------------------------------------- /man/getYhat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/addCatVars.R 3 | \name{getYhat} 4 | \alias{getYhat} 5 | \title{Get predicted value from object of class "lm"} 6 | \usage{ 7 | getYhat(fit, group = "D", mode = 1) 8 | } 9 | \arguments{ 10 | \item{fit}{Object of class "lm"} 11 | 12 | \item{group}{names of dummy variables in formula} 13 | 14 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 15 | } 16 | \description{ 17 | Get predicted value from object of class "lm" 18 | } 19 | \examples{ 20 | iris1=addCatVars(iris,c("Species")) 21 | iris3=addCatVars(iris,c("Species"),mode=3) 22 | fit1=lm(Sepal.Length~Sepal.Width+D1+D2,data=iris1) 23 | getYhat(fit1) 24 | fit1=lm(Sepal.Length~D2*Sepal.Width+Sepal.Width*D1+Petal.Width,data=iris1) 25 | getYhat(fit1) 26 | fit3=lm(Sepal.Length~D2*Sepal.Width+Sepal.Width*D1+Petal.Width*D1+Petal.Width*D2,data=iris3) 27 | getYhat(fit3,mode=3) 28 | } 29 | -------------------------------------------------------------------------------- /man/getYhat1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meanSummary.R 3 | \name{getYhat1} 4 | \alias{getYhat1} 5 | \title{Get Yhat value from simple mediation} 6 | \usage{ 7 | getYhat1( 8 | data, 9 | X = NULL, 10 | M = NULL, 11 | Y = NULL, 12 | labels, 13 | digits = 3, 14 | maxylev = 6, 15 | mode = 1 16 | ) 17 | } 18 | \arguments{ 19 | \item{data}{A data.frame} 20 | 21 | \item{X}{Name of independent variable} 22 | 23 | \item{M}{Name of moderator variable} 24 | 25 | \item{Y}{Name of dependant variable} 26 | 27 | \item{labels}{optional list of labels} 28 | 29 | \item{digits}{Integer indicating the number of decimal places} 30 | 31 | \item{maxylev}{maximal unique length of categorical variable} 32 | 33 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 34 | } 35 | \description{ 36 | Get Yhat value from simple mediation 37 | } 38 | \examples{ 39 | data=protest 40 | labels=list(X="protest",M="respappr",Y="liking") 41 | getYhat1(data=protest,labels=labels) 42 | } 43 | -------------------------------------------------------------------------------- /man/ggCor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{ggCor} 4 | \alias{ggCor} 5 | \title{Draw a heatmap of correlation test} 6 | \usage{ 7 | ggCor( 8 | data, 9 | what = 1, 10 | label = 0, 11 | colors = NULL, 12 | title = TRUE, 13 | mode = 2, 14 | digits = 2, 15 | yreverse = TRUE, 16 | xangle = 45, 17 | yangle = 0, 18 | use.label = FALSE 19 | ) 20 | } 21 | \arguments{ 22 | \item{data}{A data.frame} 23 | 24 | \item{what}{if 1, correlation, if 2, partial correlation, if 3, semi-partial correlation} 25 | 26 | \item{label}{if 0, no label(default), if 1, use r value as label, if 2, use r value with significant mark as label} 27 | 28 | \item{colors}{colors for low, mid and high correlation values} 29 | 30 | \item{title}{if true, add title to the heatmap} 31 | 32 | \item{mode}{1 or 2} 33 | 34 | \item{digits}{The number of decimal place'} 35 | 36 | \item{yreverse}{If true, reverse y axis} 37 | 38 | \item{xangle}{x-axis text angle} 39 | 40 | \item{yangle}{y-axis text angle} 41 | 42 | \item{use.label}{Logical whether or not use label in case of labelled data} 43 | } 44 | \description{ 45 | Draw a heatmap of correlation test 46 | } 47 | -------------------------------------------------------------------------------- /man/glbwarm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{glbwarm} 5 | \alias{glbwarm} 6 | \title{Global Warming dataset} 7 | \format{ 8 | A data.frame with 815 obs. of 7 variables 9 | \describe{ 10 | \item{govact}{Support for government action} 11 | \item{posemot}{Positive emotions about climate change} 12 | \item{negemot}{Negative emotions about climate change} 13 | \item{ideology}{Political ideology (conservatism), 1 = Very Liberal, 2 = Liberal, 3 = Somewhat Liberal, 4 = Moderate; Middle of the Road, 5 = Somewhat Conservative, 6 = Conservative, 7 = Very Conservative} 14 | \item{age}{Respondent age at last birthday} 15 | \item{sex}{female(0) or male(1)} 16 | \item{partyid}{1 = Democrat, 2 = Independent, 3= Republican} 17 | } 18 | } 19 | \source{ 20 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 21 | } 22 | \usage{ 23 | glbwarm 24 | } 25 | \description{ 26 | Global Warming dataset 27 | } 28 | \keyword{datasets} 29 | -------------------------------------------------------------------------------- /man/interactStr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{interactStr} 4 | \alias{interactStr} 5 | \title{make interaction equation} 6 | \usage{ 7 | interactStr(x, prefix = "a", skip = FALSE, count = 1, addPrefix = TRUE) 8 | } 9 | \arguments{ 10 | \item{x}{character vector} 11 | 12 | \item{prefix}{prefix} 13 | 14 | \item{skip}{whether or not skip} 15 | 16 | \item{count}{Numeric} 17 | 18 | \item{addPrefix}{A logical} 19 | } 20 | \description{ 21 | make interaction equation 22 | } 23 | \examples{ 24 | interactStr(LETTERS[1]) 25 | interactStr(LETTERS[1:3]) 26 | interactStr(LETTERS[1:3],skip=TRUE) 27 | } 28 | -------------------------------------------------------------------------------- /man/jnPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot.R 3 | \name{jnPlot} 4 | \alias{jnPlot} 5 | \title{Draw johnson_neyman plot} 6 | \usage{ 7 | jnPlot( 8 | fit, 9 | pred = NULL, 10 | modx = NULL, 11 | digits = 3, 12 | plot = FALSE, 13 | mode = 1, 14 | xvar = "Z", 15 | addEq = FALSE, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{fit}{A regression model} 21 | 22 | \item{pred}{name of predictor variable} 23 | 24 | \item{modx}{name of moderator variable} 25 | 26 | \item{digits}{integer indicating the number of decimal places} 27 | 28 | \item{plot}{logical. Whether or not draw plot} 29 | 30 | \item{mode}{integer 1 or 2} 31 | 32 | \item{xvar}{Name of xvar} 33 | 34 | \item{addEq}{logical} 35 | 36 | \item{...}{Further arguments to be passed to interactions::johnson_neyman()} 37 | } 38 | \description{ 39 | Draw johnson_neyman plot 40 | } 41 | \examples{ 42 | fit=lm(mpg~hp*wt,data=mtcars) 43 | jnPlot(fit) 44 | \donttest{ 45 | fit=lm(justify~frame*skeptic,data=disaster) 46 | res=jnPlot(fit) 47 | res$plot 48 | fit=lm(govact~negemot*sex*age+posemot+ideology,data=glbwarm) 49 | jnPlot(fit,pred="negemot:sex",modx="age",mode=2,addEq=TRUE) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /man/label2name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawModel.R 3 | \name{label2name} 4 | \alias{label2name} 5 | \title{Change label into name} 6 | \usage{ 7 | label2name(label, labels) 8 | } 9 | \arguments{ 10 | \item{label}{A string} 11 | 12 | \item{labels}{A named list} 13 | } 14 | \description{ 15 | Change label into name 16 | } 17 | \examples{ 18 | label="X:W:Z" 19 | labels=list(X="dep",W="mod",Z="mod2") 20 | label2name(label,labels) 21 | } 22 | -------------------------------------------------------------------------------- /man/labels2table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/labels2table.R 3 | \name{labels2table} 4 | \alias{labels2table} 5 | \title{Make table with labels} 6 | \usage{ 7 | labels2table( 8 | labels = labels, 9 | vars = list(), 10 | moderator = list(), 11 | covar = NULL, 12 | serial = TRUE, 13 | bmatrix = NULL, 14 | eq = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{labels}{A list} 19 | 20 | \item{vars}{A list} 21 | 22 | \item{moderator}{A list} 23 | 24 | \item{covar}{A list} 25 | 26 | \item{serial}{A logical} 27 | 28 | \item{bmatrix}{integer specifying causal relations among mediators} 29 | 30 | \item{eq}{Optional string contains equation} 31 | } 32 | \description{ 33 | Make table with labels 34 | } 35 | \examples{ 36 | labels=list(X="frame",M="justify",Y="donate",W="skeptic") 37 | moderator=list(name="skeptic",site=list(c("a","c"))) 38 | covar=list(name=c("C1","C2","C3"),site=list(c("M","Y"),c("M","Y"),c("M","Y"))) 39 | labels=list(X="X",M=c("M1","M2","M3"),Y="Y") 40 | labels=list(X="X",M=c("M1","M2"),Y="Y") 41 | moderator=list();serial=FALSE;eq=NULL 42 | labels2table(labels) 43 | labels2table(labels,serial=FALSE) 44 | labels2table(labels,covar=covar) 45 | labels2table(labels,moderator=moderator) 46 | labels=list(X="X",M="M",Y="Y") 47 | moderator=list(name=c("W"),site=list(c("b","c"))) 48 | labels2table(labels,moderator=moderator) 49 | labels=list(X="baby",M="wine",Y="tile") 50 | moderator=list(name=c("milk"),site=list("a")) 51 | covar=list(name=c("milk","tent","sand"),site=list(c("Y"),c("M","Y"),c("M","Y"))) 52 | labels2table(labels,moderator=moderator,covar=covar,serial=FALSE) 53 | } 54 | -------------------------------------------------------------------------------- /man/makeAnovaDf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat.R 3 | \name{makeAnovaDf} 4 | \alias{makeAnovaDf} 5 | \title{Make data summarizing ANOVA results} 6 | \usage{ 7 | makeAnovaDf( 8 | labels, 9 | data, 10 | yvar = "Y", 11 | total = FALSE, 12 | addvars = TRUE, 13 | maxylev = 6, 14 | mode = 1, 15 | rangemode = 2 16 | ) 17 | } 18 | \arguments{ 19 | \item{labels}{Named list of variables} 20 | 21 | \item{data}{A data.frame} 22 | 23 | \item{yvar}{Label of the dependent variable. Either "Y"(default) or "M".} 24 | 25 | \item{total}{logical. If true, model include mediator variable.} 26 | 27 | \item{addvars}{logical. Whether or not add categorical variables to the data} 28 | 29 | \item{maxylev}{maximal unique length of categorical variable} 30 | 31 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 32 | 33 | \item{rangemode}{rangemode. 1 or 2.} 34 | } 35 | \description{ 36 | Make data summarizing ANOVA results 37 | } 38 | \examples{ 39 | labels=list(X="protest",W="sexism",M="respappr",Y="liking") 40 | makeAnovaDf(labels=labels,data=protest,total=TRUE,mode=3) 41 | } 42 | -------------------------------------------------------------------------------- /man/makeCEDf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat.R 3 | \name{makeCEDf} 4 | \alias{makeCEDf} 5 | \title{Make data summarizing conditional effects} 6 | \usage{ 7 | makeCEDf( 8 | labels = labels, 9 | data, 10 | yvar = "Y", 11 | total = FALSE, 12 | addvars = TRUE, 13 | maxylev = 6, 14 | mode = 1, 15 | rangemode = 2 16 | ) 17 | } 18 | \arguments{ 19 | \item{labels}{Named list of variables} 20 | 21 | \item{data}{A data.frame} 22 | 23 | \item{yvar}{Label of the dependent variable. Either "Y"(default) or "M".} 24 | 25 | \item{total}{logical. If true, model include mediator variable.} 26 | 27 | \item{addvars}{logical. Whether or not add categorical variables to the data} 28 | 29 | \item{maxylev}{maximal unique length of categorical variable} 30 | 31 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 32 | 33 | \item{rangemode}{rangemode. 1 or 2.} 34 | } 35 | \description{ 36 | Make data summarizing conditional effects 37 | } 38 | \examples{ 39 | labels=list(X="protest",W="sexism",M="respappr",Y="liking") 40 | data1=addCatVars(protest,varnames="protest",mode=1) 41 | makeCEDf(labels=labels,data=protest,mode=1) 42 | } 43 | -------------------------------------------------------------------------------- /man/makeCatEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeCatEquation.R 3 | \name{makeCatEquation} 4 | \alias{makeCatEquation} 5 | \title{Make equation for sem and lm for categorical variables} 6 | \usage{ 7 | makeCatEquation( 8 | X = NULL, 9 | Y = NULL, 10 | W = NULL, 11 | labels = list(), 12 | data, 13 | prefix = "b", 14 | maxylev = 6, 15 | grouplabels = list(), 16 | mode = 0 17 | ) 18 | } 19 | \arguments{ 20 | \item{X}{Name of independent variable} 21 | 22 | \item{Y}{Name of dependent variable} 23 | 24 | \item{W}{Name of moderators} 25 | 26 | \item{labels}{optional list} 27 | 28 | \item{data}{a data.frame} 29 | 30 | \item{prefix}{a character} 31 | 32 | \item{maxylev}{maximal unique length of categorical variable} 33 | 34 | \item{grouplabels}{A list} 35 | 36 | \item{mode}{A numeric} 37 | } 38 | \description{ 39 | Make equation for sem and lm for categorical variables 40 | } 41 | \examples{ 42 | makeCatEquation(X="wt",Y="mpg",data=mtcars) 43 | makeCatEquation(X="wt",Y="mpg",W="cyl",data=mtcars) 44 | makeCatEquation(X="wt",Y="mpg",W=c("cyl","hp"),data=mtcars) 45 | grouplabels=list(carb="f") 46 | makeCatEquation(X="carb",Y="mpg",W=c("cyl","hp"),data=mtcars,maxylev=6) 47 | makeCatEquation(X="carb",Y="mpg",W=c("cyl","hp"),data=mtcars) 48 | cat(makeCatEquation(X="wt",Y="carb",W=c("am","hp"),data=mtcars,maxylev=6,grouplabels=grouplabels)) 49 | } 50 | -------------------------------------------------------------------------------- /man/makeCatEquation2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeCatEquation.R 3 | \name{makeCatEquation2} 4 | \alias{makeCatEquation2} 5 | \title{Make equation for sem and lm for multiple X or multiple Y} 6 | \usage{ 7 | makeCatEquation2( 8 | X = NULL, 9 | Y = NULL, 10 | W = NULL, 11 | labels = list(), 12 | vars = list(), 13 | prefix = "b", 14 | mode = 0, 15 | pos = list(), 16 | serial = FALSE, 17 | depy = FALSE, 18 | depx = FALSE 19 | ) 20 | } 21 | \arguments{ 22 | \item{X}{Names of independent variable} 23 | 24 | \item{Y}{Names of dependent variable} 25 | 26 | \item{W}{Names of moderators} 27 | 28 | \item{labels}{optional list} 29 | 30 | \item{vars}{optional list} 31 | 32 | \item{prefix}{a character} 33 | 34 | \item{mode}{A numeric} 35 | 36 | \item{pos}{Numeric moderator position} 37 | 38 | \item{serial}{logical If TRUE, serial variables are added} 39 | 40 | \item{depy}{logical} 41 | 42 | \item{depx}{logical} 43 | } 44 | \description{ 45 | Make equation for sem and lm for multiple X or multiple Y 46 | } 47 | \examples{ 48 | makeCatEquation2(X="wt",Y="mpg") 49 | makeCatEquation2(X="wt",Y="mpg",W="cyl") 50 | makeCatEquation2(X="wt",Y=c("cyl","am"),prefix="a") 51 | makeCatEquation2(X="wt",Y=c("hp","vs"),W="cyl",prefix="a") 52 | makeCatEquation2(X="wt",Y=c("hp","vs"),W=c("cyl","am"),prefix="a",pos=list(1,2)) 53 | makeCatEquation2(X="wt",Y=c("hp","vs"),W=c("cyl"),prefix="a",pos=list(1)) 54 | makeCatEquation2(X="wt",Y=c("hp","vs"),W=c("cyl"),prefix="a",pos=list(c(1,2))) 55 | makeCatEquation2(X=c("hp","vs"),Y="mpg",W=c("cyl"),prefix="b",pos=list(c(1))) 56 | makeCatEquation2(X=c("hp","vs"),Y="mpg",W=c("cyl"),prefix="b") 57 | makeCatEquation2(X=c("hp","vs"),Y="mpg",W=c("cyl"),prefix="b",pos=list(c(1,2))) 58 | cat(makeCatEquation2(X="wt",Y="carb",W=c("am","hp"))) 59 | cat(makeCatEquation2(X="X",Y=c("M1","M2","M3"),W=NULL,prefix="a",serial=TRUE)) 60 | cat(makeCatEquation2(X="X",Y=c("M1","M2","M3"),W=NULL,prefix="a")) 61 | cat(makeCatEquation2(X="X",Y=c("M1","M2"),prefix="a",mode=1,serial=TRUE)) 62 | } 63 | -------------------------------------------------------------------------------- /man/makeCatEquation3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeCatEquation.R 3 | \name{makeCatEquation3} 4 | \alias{makeCatEquation3} 5 | \title{Make equation for sem and lm for multiple X or multiple Y} 6 | \usage{ 7 | makeCatEquation3( 8 | X = NULL, 9 | Y = NULL, 10 | W = NULL, 11 | labels = list(), 12 | prefix = "b", 13 | mode = 0, 14 | pos = list(), 15 | bmatrix = NULL, 16 | vars = list(), 17 | moderator = list(), 18 | depy = FALSE, 19 | depx = FALSE, 20 | interactionNo = 0 21 | ) 22 | } 23 | \arguments{ 24 | \item{X}{Names of independent variable} 25 | 26 | \item{Y}{Names of dependent variable} 27 | 28 | \item{W}{Names of moderators} 29 | 30 | \item{labels}{optional list} 31 | 32 | \item{prefix}{a character} 33 | 34 | \item{mode}{A numeric} 35 | 36 | \item{pos}{Numeric moderator position} 37 | 38 | \item{bmatrix}{integer specifying causal relations among mediators} 39 | 40 | \item{vars}{A list of triple moderator} 41 | 42 | \item{moderator}{A list} 43 | 44 | \item{depy}{logical} 45 | 46 | \item{depx}{logical} 47 | 48 | \item{interactionNo}{numeric} 49 | } 50 | \description{ 51 | Make equation for sem and lm for multiple X or multiple Y 52 | } 53 | \examples{ 54 | cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,0,0,1,1,1,1))) 55 | cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,0,1,1,1,1,1))) 56 | cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,1,0,1,1,1,1))) 57 | cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1))) 58 | cat(makeCatEquation3(X=c("M1","M2","M3"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1),depy=TRUE)) 59 | cat(makeCatEquation3(X="X",Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1),depy=TRUE,depx=TRUE)) 60 | cat(makeCatEquation3(X="X",Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,0,1,1,1),depy=TRUE,depx=TRUE)) 61 | cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,0,1),depy=TRUE)) 62 | cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,0),depy=TRUE)) 63 | cat(makeCatEquation3(X="X",Y=c("M1","M2"),prefix="a",bmatrix=c(1,1,1,0,0,1),depy=FALSE)) 64 | cat(makeCatEquation3(X="X",Y=c("M1","M2"),W="W",prefix="a",bmatrix=c(1,1,1,1,1,1),depy=FALSE, 65 | moderator=list(name="W",matrix=list(c(0,0,1,0,0,0))))) 66 | cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,0,1),depy=TRUE)) 67 | cat(makeCatEquation3(X=c("M1","M2"),Y="Y",W="W",pos=list(c(1,2)),prefix="a", 68 | bmatrix=c(1,1,1,1,0,1),depy=TRUE)) 69 | cat(makeCatEquation3(X=c("M1","M2"),Y="Y",W="W", 70 | moderator=list(name="W",matrix=list(c(0,0,0,0,1,1))),bmatrix=c(1,1,1,1,1,1),depy=TRUE)) 71 | vars=list(name=list(c("W","Z")),matrix=list(c(0,0,1,0,0,0))) 72 | cat(makeCatEquation3(X="X",Y=c("M1","M2"),bmatrix=c(1,1,1,1,1,0),vars=vars,depy=FALSE,depx=TRUE)) 73 | } 74 | -------------------------------------------------------------------------------- /man/makeCatModel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat.R 3 | \name{makeCatModel} 4 | \alias{makeCatModel} 5 | \title{Make simple regression model with one categorical variable} 6 | \usage{ 7 | makeCatModel( 8 | labels = labels, 9 | data, 10 | yvar = "Y", 11 | total = FALSE, 12 | addvars = TRUE, 13 | maxylev = 6, 14 | mode = 1 15 | ) 16 | } 17 | \arguments{ 18 | \item{labels}{Named list of variables} 19 | 20 | \item{data}{A data.frame} 21 | 22 | \item{yvar}{Label of the dependent variable. Either "Y"(default) or "M".} 23 | 24 | \item{total}{logical. If true, model include mediator variable.} 25 | 26 | \item{addvars}{logical. Whether or not add categorical variables to the data} 27 | 28 | \item{maxylev}{maximal unique length of categorical variable} 29 | 30 | \item{mode}{Numeric. One of 1:4. 1= simple indicator coding, 2= sequential coding, 3= Helmert coding, 4= effect coding} 31 | } 32 | \value{ 33 | An object of class lm 34 | } 35 | \description{ 36 | Make simple regression model with one categorical variable 37 | } 38 | \examples{ 39 | labels=list(X="protest",W="sexism",M="respappr",Y="liking") 40 | data1=addCatVars(protest,"protest") 41 | makeCatModel(labels=labels,data=data1) 42 | } 43 | -------------------------------------------------------------------------------- /man/makeCoefLabel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{makeCoefLabel} 4 | \alias{makeCoefLabel} 5 | \title{Change regression coefficient name} 6 | \usage{ 7 | makeCoefLabel(name, dep, labels, constant, prefix) 8 | } 9 | \arguments{ 10 | \item{name}{string vector to change} 11 | 12 | \item{dep}{names of dependent variable} 13 | 14 | \item{labels}{optional list} 15 | 16 | \item{constant}{name of constant} 17 | 18 | \item{prefix}{name of prefix} 19 | } 20 | \description{ 21 | Change regression coefficient name 22 | } 23 | -------------------------------------------------------------------------------- /man/makeEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{makeEquation} 4 | \alias{makeEquation} 5 | \title{Make mediation equations 3} 6 | \usage{ 7 | makeEquation(X, M, Y, add2ndMediation = TRUE, covar = list()) 8 | } 9 | \arguments{ 10 | \item{X}{A character vectors indicating independent variables} 11 | 12 | \item{M}{A character vectors indicating mediators} 13 | 14 | \item{Y}{A character vectors indicating dependent variables} 15 | 16 | \item{add2ndMediation}{whether or not make a secondmediation equation} 17 | 18 | \item{covar}{Optional list of covariates} 19 | } 20 | \description{ 21 | Make mediation equations 3 22 | } 23 | \examples{ 24 | X="X";M=c("M1","M2","M3");Y=c("Y1","Y2");add2ndMediation=TRUE 25 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M1","Y1"),"Y2","Y2")) 26 | cat(makeEquation(X,M,Y,covar=covar)) 27 | } 28 | -------------------------------------------------------------------------------- /man/makeEquation1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{makeEquation1} 4 | \alias{makeEquation1} 5 | \title{Make mediation equations 1} 6 | \usage{ 7 | makeEquation1(X, M, stage = 1, start = 0, add2ndMediation = TRUE) 8 | } 9 | \arguments{ 10 | \item{X}{A character vectors indicating independent variables} 11 | 12 | \item{M}{A character vectors indicating mediators} 13 | 14 | \item{stage}{An integer indicating the order} 15 | 16 | \item{start}{An integer} 17 | 18 | \item{add2ndMediation}{whether or not make a secondmediation equation} 19 | } 20 | \description{ 21 | Make mediation equations 1 22 | } 23 | -------------------------------------------------------------------------------- /man/makeEquation2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{makeEquation2} 4 | \alias{makeEquation2} 5 | \title{Make mediation equations 2} 6 | \usage{ 7 | makeEquation2(X, M, Y) 8 | } 9 | \arguments{ 10 | \item{X}{A character vectors indicating independent variables} 11 | 12 | \item{M}{A character vectors indicating mediators} 13 | 14 | \item{Y}{A character vectors indicating dependent variables} 15 | } 16 | \description{ 17 | Make mediation equations 2 18 | } 19 | -------------------------------------------------------------------------------- /man/makeEquation3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{makeEquation3} 4 | \alias{makeEquation3} 5 | \title{Make mediation equations 3} 6 | \usage{ 7 | makeEquation3(X, M, Y, add2ndMediation = TRUE) 8 | } 9 | \arguments{ 10 | \item{X}{A character vectors indicating independent variables} 11 | 12 | \item{M}{A character vectors indicating mediators} 13 | 14 | \item{Y}{A character vectors indicating dependent variables} 15 | 16 | \item{add2ndMediation}{whether or not make a secondmediation equation} 17 | } 18 | \description{ 19 | Make mediation equations 3 20 | } 21 | -------------------------------------------------------------------------------- /man/makeIndirectEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{makeIndirectEquation} 4 | \alias{makeIndirectEquation} 5 | \title{Make indirect equation} 6 | \usage{ 7 | makeIndirectEquation( 8 | X, 9 | M, 10 | temp1, 11 | temp2, 12 | temp3, 13 | moderatorNames, 14 | range = FALSE, 15 | data = NULL, 16 | rangemode = 1, 17 | probs = c(0.16, 0.5, 0.84), 18 | effectsize = FALSE, 19 | Y = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{X}{A character string} 24 | 25 | \item{M}{A character string} 26 | 27 | \item{temp1}{A character vector} 28 | 29 | \item{temp2}{A character vector} 30 | 31 | \item{temp3}{A character vector} 32 | 33 | \item{moderatorNames}{A character vector} 34 | 35 | \item{range}{A logical} 36 | 37 | \item{data}{A data.frame} 38 | 39 | \item{rangemode}{range mode} 40 | 41 | \item{probs}{numeric vector of probabilities with values in [0,1]} 42 | 43 | \item{effectsize}{logical If true, calculate effect size.} 44 | 45 | \item{Y}{Optional character string} 46 | } 47 | \description{ 48 | Make indirect equation 49 | } 50 | \examples{ 51 | X="negemot";M="ideology" 52 | temp1=c("a1*negemot","a2*sex","a4*negemot*sex","a5*negemot*age","a6*sex*age") 53 | temp2="b1*ideology" 54 | temp3="c1*negemot" 55 | moderatorNames=c("age","sex") 56 | X= "hp";M= "am" 57 | temp1= c("a1*hp","a2*wt","a3*hp:wt") 58 | temp2= "b1*am" 59 | temp3= c("c1*hp","c2*wt","c3*hp:wt") 60 | #moderatorNames=c("wt") 61 | #X= c("d1","d2");M="am" 62 | #temp1=c("a1*d1","a2*d2","a3*wt","a4*d1:wt","a5*d2:wt") 63 | #temp2="b1*am" 64 | #temp3=c("c1*d1","c2*d2","c3*wt","c4*d1:wt","c5*d2:wt") 65 | cat(makeIndirectEquation(X,M,temp1,temp2,temp3,moderatorNames)) 66 | cat(makeIndirectEquation(X,M,temp1,temp2,temp3,moderatorNames,range=TRUE)) 67 | X="wt";M=NULL;temp1=NULL;temp2=NULL;temp3=c("c1*wt","c2*hp","c3*wt:hp"); 68 | moderatorNames="hp";range=TRUE;rangemode=1;probs=c(0.16,0.5,0.84) 69 | cat(makeIndirectEquation(X,M,temp1,temp2,temp3,moderatorNames,range=TRUE)) 70 | X="frame:skeptic"; M="justify";temp1="a1*frame:skeptic"; 71 | temp2="b1*justify";temp3="c1*frame:skeptic";moderatorNames=NULL 72 | range=TRUE;rangemode=1 73 | } 74 | -------------------------------------------------------------------------------- /man/makeIndirectEquationCat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/catMediation.R 3 | \name{makeIndirectEquationCat} 4 | \alias{makeIndirectEquationCat} 5 | \title{Make indirect equation for categorical variables} 6 | \usage{ 7 | makeIndirectEquationCat( 8 | X, 9 | M, 10 | temp1, 11 | temp2, 12 | temp3, 13 | moderatorNames, 14 | range = TRUE, 15 | data = NULL, 16 | rangemode = 1, 17 | probs = c(0.16, 0.5, 0.84), 18 | grouplabels = list() 19 | ) 20 | } 21 | \arguments{ 22 | \item{X}{A character vector} 23 | 24 | \item{M}{A character vector} 25 | 26 | \item{temp1}{A character vector} 27 | 28 | \item{temp2}{A character vector} 29 | 30 | \item{temp3}{A character vector} 31 | 32 | \item{moderatorNames}{A character vector} 33 | 34 | \item{range}{A logical} 35 | 36 | \item{data}{A data.frame} 37 | 38 | \item{rangemode}{range mode} 39 | 40 | \item{probs}{numeric vector of probabilities with values in [0,1]} 41 | 42 | \item{grouplabels}{A list} 43 | } 44 | \description{ 45 | Make indirect equation for categorical variables 46 | } 47 | -------------------------------------------------------------------------------- /man/makeIndirectEquationCat2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{makeIndirectEquationCat2} 4 | \alias{makeIndirectEquationCat2} 5 | \title{Make indirect equation for categorical variables} 6 | \usage{ 7 | makeIndirectEquationCat2( 8 | X, 9 | M, 10 | temp1, 11 | temp2, 12 | temp3, 13 | moderatorNames, 14 | range = TRUE, 15 | data = NULL, 16 | rangemode = 1, 17 | probs = c(0.16, 0.5, 0.84), 18 | serial = FALSE, 19 | contrast = 1 20 | ) 21 | } 22 | \arguments{ 23 | \item{X}{A character vector} 24 | 25 | \item{M}{A character vector} 26 | 27 | \item{temp1}{A character vector} 28 | 29 | \item{temp2}{A character vector} 30 | 31 | \item{temp3}{A character vector} 32 | 33 | \item{moderatorNames}{A character vector} 34 | 35 | \item{range}{A logical} 36 | 37 | \item{data}{A data.frame} 38 | 39 | \item{rangemode}{range mode} 40 | 41 | \item{probs}{numeric vector of probabilities with values in [0,1]} 42 | 43 | \item{serial}{logical If TRUE, serial variables are added} 44 | 45 | \item{contrast}{integer If 2, absolute difference of contrasts are calculated} 46 | } 47 | \description{ 48 | Make indirect equation for categorical variables 49 | } 50 | -------------------------------------------------------------------------------- /man/makeLabel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot2.R 3 | \name{makeLabel} 4 | \alias{makeLabel} 5 | \title{Make Labels} 6 | \usage{ 7 | makeLabel( 8 | fit, 9 | pred, 10 | modx, 11 | mod2, 12 | mod2.values = c(30, 50, 70), 13 | xvar = "Z", 14 | digits = 3 15 | ) 16 | } 17 | \arguments{ 18 | \item{fit}{An object of class lm} 19 | 20 | \item{pred}{name of the predictor variable} 21 | 22 | \item{modx}{name of the moderator variable} 23 | 24 | \item{mod2}{name of the second moderator variable} 25 | 26 | \item{mod2.values}{values of moderator variable} 27 | 28 | \item{xvar}{character. "Z" or "W"} 29 | 30 | \item{digits}{integer indicating the number of decimal places} 31 | } 32 | \description{ 33 | Make Labels 34 | } 35 | -------------------------------------------------------------------------------- /man/makePPTx.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makePPTx.R 3 | \name{makePPTx} 4 | \alias{makePPTx} 5 | \title{make powerpoint presentation} 6 | \usage{ 7 | makePPTx( 8 | data, 9 | preprocessing = "", 10 | filename = "report.pptx", 11 | rawDataName = NULL, 12 | rawDataFile = "rawData.RDS", 13 | rmdRemove = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{A data.frame with title and code} 18 | 19 | \item{preprocessing}{string preprocessing} 20 | 21 | \item{filename}{character name of output file} 22 | 23 | \item{rawDataName}{The name of the rawData} 24 | 25 | \item{rawDataFile}{The name of the rawData file which the data are to be read from} 26 | 27 | \item{rmdRemove}{A logical} 28 | } 29 | \description{ 30 | make powerpoint presentation 31 | } 32 | -------------------------------------------------------------------------------- /man/matrix2df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/matrixPlot.R 3 | \name{matrix2df} 4 | \alias{matrix2df} 5 | \title{Make data.frame with matrix} 6 | \usage{ 7 | matrix2df(matrix = c(1, 1, 1, 0, 0, 1), labels = NULL) 8 | } 9 | \arguments{ 10 | \item{matrix}{a numeric vector} 11 | 12 | \item{labels}{Optional list of labels} 13 | } 14 | \description{ 15 | Make data.frame with matrix 16 | } 17 | \examples{ 18 | labels=list(X="indep",M=c("med1","med2"),Y="dep") 19 | matrix2df(c(1,1,1,0,0,1),labels=labels) 20 | } 21 | -------------------------------------------------------------------------------- /man/matrix2no.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/matrixPlot.R 3 | \name{matrix2no} 4 | \alias{matrix2no} 5 | \title{Calculate the dimension of matrix} 6 | \usage{ 7 | matrix2no(matrix = c(1, 1, 1, 0, 0, 1)) 8 | } 9 | \arguments{ 10 | \item{matrix}{a numeric vector} 11 | } 12 | \description{ 13 | Calculate the dimension of matrix 14 | } 15 | \examples{ 16 | matrix2no(c(1,1,1,0,0,1)) 17 | } 18 | -------------------------------------------------------------------------------- /man/matrixPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/matrixPlot.R 3 | \name{matrixPlot} 4 | \alias{matrixPlot} 5 | \title{Draw matrix plot} 6 | \usage{ 7 | matrixPlot( 8 | matrix = c(1, 1, 1, 0, 0, 1), 9 | radx = 0.1, 10 | rady = 0.05, 11 | xlim = NULL, 12 | ylim = NULL, 13 | labels = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{matrix}{A numeric vector} 18 | 19 | \item{radx}{horizontal radius of the box.} 20 | 21 | \item{rady}{vertical radius of the box.} 22 | 23 | \item{xlim}{the x limits (min,max) of the plot} 24 | 25 | \item{ylim}{the y limits (min,max) of the plot} 26 | 27 | \item{labels}{Optional list of labels} 28 | } 29 | \description{ 30 | Draw matrix plot 31 | } 32 | \examples{ 33 | matrixPlot(c(1,1,1)) 34 | labels=list(X="X",M=c("M1","M2"),Y="Y") 35 | bmatrix=c(1,1,1,0,0,1) 36 | eq=multipleMediation(labels=labels,bmatrix=bmatrix,mode=1) 37 | drawModel(equation=eq,labels=labels,nodemode=2) 38 | matrixPlot(bmatrix) 39 | bmatrix=c(1,1,0,1,0,0,1,1,1,1) 40 | matrixPlot(c(1,1,0,1,0,0,1,1,1,1)) 41 | labels=list(X="X",M=c("M1","M2","M3"),Y="Y") 42 | eq=multipleMediation(labels=labels,bmatrix=bmatrix,mode=1) 43 | drawModel(equation=eq,labels=labels,parallel=TRUE,nodemode=2) 44 | labels=list(X="indep",M=c("med1","med2"),Y="dep") 45 | matrixPlot(c(1,1,1,0,0,1),labels=labels) 46 | } 47 | -------------------------------------------------------------------------------- /man/meanCentering.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{meanCentering} 4 | \alias{meanCentering} 5 | \title{Perform mean centering} 6 | \usage{ 7 | meanCentering(data, names) 8 | } 9 | \arguments{ 10 | \item{data}{A data.frame} 11 | 12 | \item{names}{column names to mean centering} 13 | } 14 | \description{ 15 | Perform mean centering 16 | } 17 | \examples{ 18 | library(processR) 19 | newData=meanCentering(education,colnames(education)[1:3]) 20 | } 21 | -------------------------------------------------------------------------------- /man/meanSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meanSummary.R 3 | \name{meanSummary} 4 | \alias{meanSummary} 5 | \title{Make mean summary table} 6 | \usage{ 7 | meanSummary( 8 | data, 9 | X = NULL, 10 | Y = NULL, 11 | M = NULL, 12 | W = NULL, 13 | labels = labels, 14 | digits = 3, 15 | xlabels = NULL, 16 | maxylev = 6, 17 | mode = 1 18 | ) 19 | } 20 | \arguments{ 21 | \item{data}{A data.frame} 22 | 23 | \item{X}{Name of independent variable} 24 | 25 | \item{Y}{Name of dependent variable} 26 | 27 | \item{M}{Name of mediator variable} 28 | 29 | \item{W}{Name of moderator variable} 30 | 31 | \item{labels}{A list of labels} 32 | 33 | \item{digits}{Integer indicating the number of decimal places} 34 | 35 | \item{xlabels}{Optional string vector} 36 | 37 | \item{maxylev}{maximal unique length of categorical variable} 38 | 39 | \item{mode}{integer} 40 | } 41 | \description{ 42 | Make mean summary table 43 | } 44 | \examples{ 45 | labels=list(X="cond",Y="reaction",M="pmi") 46 | xlabels=c("Front Page","Interior Page") 47 | meanSummary(data=pmi,labels=labels,xlabels=xlabels) 48 | labels=list(X="frame",Y="justify",W="skeptic") 49 | xlabels=c("Natural causes condition","Climate change condition") 50 | meanSummary(data=disaster,labels=labels,xlabels=xlabels) 51 | labels=list(X="protest",Y="liking",M="respappr") 52 | meanSummary(data=protest,labels=labels) 53 | meanSummary(data=protest,labels=labels,maxylev=2) 54 | } 55 | -------------------------------------------------------------------------------- /man/meanSummaryTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meanSummary.R 3 | \name{meanSummaryTable} 4 | \alias{meanSummaryTable} 5 | \title{Make mean summary table} 6 | \usage{ 7 | meanSummaryTable(..., vanilla = TRUE) 8 | } 9 | \arguments{ 10 | \item{...}{Further arguments to be passed to meanSummary} 11 | 12 | \item{vanilla}{logical} 13 | } 14 | \description{ 15 | Make mean summary table 16 | } 17 | \examples{ 18 | labels=list(X="cond",Y="reaction",M="pmi") 19 | xlabels=c("Front Page","Interior Page") 20 | meanSummaryTable(data=pmi,labels=labels,xlabels=xlabels) 21 | labels=list(X="frame",Y="justify",W="skeptic") 22 | xlabels=c("Natural causes condition","Climate change condition") 23 | meanSummaryTable(data=disaster,labels=labels,xlabels=xlabels) 24 | } 25 | -------------------------------------------------------------------------------- /man/medSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{medSummary} 4 | \alias{medSummary} 5 | \title{Summarize the mediation effects} 6 | \usage{ 7 | medSummary(semfit, boot.ci.type = "perc", effects = c("indirect", "direct")) 8 | } 9 | \arguments{ 10 | \item{semfit}{An object of class lavaan} 11 | 12 | \item{boot.ci.type}{Type of bootstrapping interval. Choices are c("norm","basic","perc",bca.simple","all")} 13 | 14 | \item{effects}{Names of effects to be summarized} 15 | } 16 | \value{ 17 | A data.frame and an object of class medSummary 18 | } 19 | \description{ 20 | Summarize the mediation effects 21 | } 22 | \examples{ 23 | library(lavaan) 24 | labels=list(X="cond",M="pmi",Y="reaction") 25 | model=tripleEquation(labels=labels) 26 | \donttest{ 27 | semfit=sem(model=model,data=pmi, se="boot", bootstrap=100) 28 | medSummary(semfit) 29 | medSummary(semfit,boot.ci.type="all") 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /man/medSummaryTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{medSummaryTable} 4 | \alias{medSummaryTable} 5 | \title{Make a table summarizing the mediation effects} 6 | \usage{ 7 | medSummaryTable(x, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class medSummary or medSummary2 or lavaan} 11 | 12 | \item{vanilla}{A logical} 13 | 14 | \item{...}{Further arguments to be passed to medSummary} 15 | } 16 | \description{ 17 | Make a table summarizing the mediation effects 18 | } 19 | -------------------------------------------------------------------------------- /man/medSummaryTable1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{medSummaryTable1} 4 | \alias{medSummaryTable1} 5 | \title{Make a table summarizing the mediation effects} 6 | \usage{ 7 | medSummaryTable1(x, vanilla = TRUE, showP = FALSE) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class medSummary} 11 | 12 | \item{vanilla}{A logical} 13 | 14 | \item{showP}{A logical} 15 | } 16 | \description{ 17 | Make a table summarizing the mediation effects 18 | } 19 | -------------------------------------------------------------------------------- /man/medSummaryTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{medSummaryTable2} 4 | \alias{medSummaryTable2} 5 | \title{Make a table summarizing the mediation effects} 6 | \usage{ 7 | medSummaryTable2(x, vanilla = TRUE) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class medSummary2} 11 | 12 | \item{vanilla}{A logical} 13 | } 14 | \description{ 15 | Make a table summarizing the mediation effects 16 | } 17 | -------------------------------------------------------------------------------- /man/mediationBK.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mediationBK.R 3 | \name{mediationBK} 4 | \alias{mediationBK} 5 | \title{Perform mediation analysis by Baron and Kenny Method} 6 | \usage{ 7 | mediationBK( 8 | X = NULL, 9 | M = NULL, 10 | Y = NULL, 11 | labels = list(), 12 | data, 13 | silent = TRUE, 14 | indirect.test = TRUE, 15 | sig = 0.05 16 | ) 17 | } 18 | \arguments{ 19 | \item{X}{name of independent variable} 20 | 21 | \item{M}{name of mediator variable} 22 | 23 | \item{Y}{name of dependent variable} 24 | 25 | \item{labels}{An optional list of variable names} 26 | 27 | \item{data}{A data.frame} 28 | 29 | \item{silent}{Logical. Whether or not show summary of regression tests} 30 | 31 | \item{indirect.test}{Logical. Whether or not show results of bda.mediation.test} 32 | 33 | \item{sig}{significant level. default value is 0.05} 34 | } 35 | \description{ 36 | Perform mediation analysis by Baron and Kenny Method 37 | } 38 | \examples{ 39 | labels=list(X="cond",M="pmi",Y="reaction") 40 | result=mediationBK(labels=labels,data=pmi,silent=FALSE) 41 | result 42 | } 43 | -------------------------------------------------------------------------------- /man/modSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary.R 3 | \name{modSummary} 4 | \alias{modSummary} 5 | \title{Make moderation effect summary} 6 | \usage{ 7 | modSummary(semfit, mod = NULL, values = NULL, boot.ci.type = "bca.simple") 8 | } 9 | \arguments{ 10 | \item{semfit}{An object of class lavaan} 11 | 12 | \item{mod}{name of moderator variable} 13 | 14 | \item{values}{optional values of moderator} 15 | 16 | \item{boot.ci.type}{Type of bootstrapping interval. Choices are c("norm","basic","perc",bca.simple")} 17 | } 18 | \description{ 19 | Make moderation effect summary 20 | } 21 | \examples{ 22 | require(lavaan) 23 | labels=list(X="frame",W="skeptic",M="justify",Y="donate") 24 | moderator=list(name='skeptic',site=list(c("a"))) 25 | model=tripleEquation(labels=labels,moderator=moderator,data=disaster,rangemode=2) 26 | cat(model) 27 | \dontrun{ 28 | semfit=sem(model=model,data=disaster,se="boot",bootstrap=100) 29 | modSummary(semfit) 30 | modSummaryTable(semfit) 31 | labels=list(X="dysfunc",M="negtone",Y="perform",W="negexp") 32 | moderator=list(name="negexp",site=list("b")) 33 | model=tripleEquation(labels=labels,moderator=moderator,data=teams,rangemode=2) 34 | cat(model) 35 | semfit=sem(model,data=teams,se="boot",bootstrap=100) 36 | modmedSummary(semfit) 37 | modSummaryTable(semfit) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /man/modSummary2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary2.R 3 | \name{modSummary2} 4 | \alias{modSummary2} 5 | \title{Make table summarizing moderation effect} 6 | \usage{ 7 | modSummary2( 8 | fit, 9 | rangemode = 2, 10 | pred.values = NULL, 11 | summarymode = 2, 12 | maxylev = 6, 13 | digits = 3, 14 | labels = NULL, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{fit}{An object of class lm} 20 | 21 | \item{rangemode}{An integer. If 1, mean+c(-1,0,1)*sd used. If 2, 16th, 50th and 84th percentiles are used} 22 | 23 | \item{pred.values}{Values of predictor variables} 24 | 25 | \item{summarymode}{An integer. 1 or 2. Summarizing method of variables. If 1, typical values are used. If 2, mean values are used} 26 | 27 | \item{maxylev}{An integer. Maximum length of predictor variables to be treated as a categorical variable.} 28 | 29 | \item{digits}{An integer indicating the number of decimal places} 30 | 31 | \item{labels}{Optional list of labels of variables} 32 | 33 | \item{...}{Further arguments to be passed to predict3d::fit2newdata()} 34 | } 35 | \description{ 36 | Make table summarizing moderation effect 37 | } 38 | \examples{ 39 | labels=list(X="negemot",W="sex",Z="age",Y="govact",C1="posemot",C2="ideology") 40 | fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 41 | modSummary2(fit,rangemode=2,mod2.values=c(30,50,70),summarymode=2) 42 | modSummary2(fit,mod2.values=c(30,50,70),summarymode=1,labels=labels) 43 | labels=list(X="frame",W="skeptic",Y="justify") 44 | fit=lm(justify~frame*skeptic,data=disaster) 45 | modSummary2(fit,labels=labels) 46 | } 47 | -------------------------------------------------------------------------------- /man/modSummary2Table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary2.R 3 | \name{modSummary2Table} 4 | \alias{modSummary2Table} 5 | \title{Make flextable summarizing moderation effect} 6 | \usage{ 7 | modSummary2Table(x, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object} 11 | 12 | \item{vanilla}{logical} 13 | 14 | \item{...}{Further argument to be passed to modSummary3} 15 | } 16 | \description{ 17 | Make flextable summarizing moderation effect 18 | } 19 | \examples{ 20 | fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 21 | modSummary2Table(fit) 22 | } 23 | -------------------------------------------------------------------------------- /man/modSummary3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary3.R 3 | \name{modSummary3} 4 | \alias{modSummary3} 5 | \title{Summary of moderation effect} 6 | \usage{ 7 | modSummary3( 8 | fit, 9 | X = NULL, 10 | W = NULL, 11 | Z = NULL, 12 | labels = NULL, 13 | modx.values = NULL, 14 | mod2.values = NULL, 15 | rangemode = 2, 16 | maxylev = 6, 17 | digits = 3 18 | ) 19 | } 20 | \arguments{ 21 | \item{fit}{An object of class lm} 22 | 23 | \item{X}{Name of independent variable} 24 | 25 | \item{W}{Name of the first moderator variable} 26 | 27 | \item{Z}{Name of the second moderator variable} 28 | 29 | \item{labels}{Optional list of variable names} 30 | 31 | \item{modx.values}{Values of moderator variable} 32 | 33 | \item{mod2.values}{Values of the second moderator variable} 34 | 35 | \item{rangemode}{Integer. 1 or 2.} 36 | 37 | \item{maxylev}{maximum unique length of variable to be treated as a categorical variable} 38 | 39 | \item{digits}{integer indicating the number of decimal places} 40 | } 41 | \description{ 42 | Summary of moderation effect 43 | } 44 | \examples{ 45 | fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 46 | modSummary3(fit,mod2.values=c(30,50,70)) 47 | fit1=lm(govact~negemot*sex*age+posemot+ideology,data=glbwarm) 48 | modSummary3(fit1,rangemode=1) 49 | fit=lm(mpg~hp*wt,data=mtcars) 50 | modSummary3(fit) 51 | } 52 | -------------------------------------------------------------------------------- /man/modSummary3Table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary3.R 3 | \name{modSummary3Table} 4 | \alias{modSummary3Table} 5 | \title{Make flextable summarizing moderation effect} 6 | \usage{ 7 | modSummary3Table(x, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object} 11 | 12 | \item{vanilla}{logical} 13 | 14 | \item{...}{Further argument to be passed to modSummary3} 15 | } 16 | \description{ 17 | Make flextable summarizing moderation effect 18 | } 19 | \examples{ 20 | fit=lm(govact~negemot*sex+negemot*age+posemot+ideology,data=glbwarm) 21 | modSummary3Table(fit,mod2.values=c(30,50,70)) 22 | } 23 | -------------------------------------------------------------------------------- /man/modSummaryTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary.R 3 | \name{modSummaryTable} 4 | \alias{modSummaryTable} 5 | \title{Make flextable summarizing moderation effect} 6 | \usage{ 7 | modSummaryTable(x, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object} 11 | 12 | \item{vanilla}{logical} 13 | 14 | \item{...}{Further argument to be passed to modSummary} 15 | } 16 | \description{ 17 | Make flextable summarizing moderation effect 18 | } 19 | -------------------------------------------------------------------------------- /man/modelFitGuideTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{modelFitGuideTable} 4 | \alias{modelFitGuideTable} 5 | \title{Model fit guide table} 6 | \usage{ 7 | modelFitGuideTable() 8 | } 9 | \description{ 10 | Model fit guide table 11 | } 12 | -------------------------------------------------------------------------------- /man/modelFitGuideTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{modelFitGuideTable2} 4 | \alias{modelFitGuideTable2} 5 | \title{Model fit guide table} 6 | \usage{ 7 | modelFitGuideTable2(vanilla = FALSE) 8 | } 9 | \arguments{ 10 | \item{vanilla}{Logical} 11 | } 12 | \description{ 13 | Model fit guide table 14 | } 15 | -------------------------------------------------------------------------------- /man/modelFitTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{modelFitTable} 4 | \alias{modelFitTable} 5 | \title{Extract model fit measures to data.frame} 6 | \usage{ 7 | modelFitTable(fit, digits = 2, names = NULL) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | 12 | \item{digits}{integer indicating the number of decimal places to be used.} 13 | 14 | \item{names}{names of statistic to be extracted} 15 | } 16 | \value{ 17 | A data.frame 18 | } 19 | \description{ 20 | Extract model fit measures to data.frame 21 | } 22 | -------------------------------------------------------------------------------- /man/modelFitTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{modelFitTable2} 4 | \alias{modelFitTable2} 5 | \title{Extract model fit measures to flextable} 6 | \usage{ 7 | modelFitTable2(fit, vanilla = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lavaan. Result of sem function of package lavaan} 11 | 12 | \item{vanilla}{Logical} 13 | 14 | \item{...}{Further arguments to be passed to modelFitTable()} 15 | } 16 | \description{ 17 | Extract model fit measures to flextable 18 | } 19 | -------------------------------------------------------------------------------- /man/modelsSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{modelsSummary} 4 | \alias{modelsSummary} 5 | \title{Make Summary for Model Coefficients} 6 | \usage{ 7 | modelsSummary( 8 | fit = NULL, 9 | labels = NULL, 10 | vars = NULL, 11 | moderator = NULL, 12 | covar = NULL, 13 | serial = FALSE, 14 | data = NULL, 15 | prefix = "b", 16 | constant = "iy", 17 | autoPrefix = TRUE 18 | ) 19 | } 20 | \arguments{ 21 | \item{fit}{A list of objects of class lm} 22 | 23 | \item{labels}{optional list} 24 | 25 | \item{vars}{optional list} 26 | 27 | \item{moderator}{optional list} 28 | 29 | \item{covar}{optional list} 30 | 31 | \item{serial}{logical} 32 | 33 | \item{data}{optional data.frame} 34 | 35 | \item{prefix}{A character} 36 | 37 | \item{constant}{A string vector} 38 | 39 | \item{autoPrefix}{logical automatic numbering of prefix} 40 | } 41 | \value{ 42 | A data.frame 43 | } 44 | \description{ 45 | Make Summary for Model Coefficients 46 | } 47 | \examples{ 48 | fit1=lm(mpg~wt,data=mtcars) 49 | fit2=lm(mpg~wt*hp*am,data=mtcars) 50 | fit=list(fit1,fit2) 51 | labels=list(Y="mpg",X="wt",W="hp",Z="am") 52 | modelsSummary(fit,labels=labels) 53 | labels=list(Y="withdraw",M="affect",X="estress") 54 | covar=list(name=c("ese","sex","age"),site=list(c("M","Y"),c("M","Y"),c("M","Y"))) 55 | modelsSummary(labels=labels,covar=covar,data=estress) 56 | labels=list(X="dysfunc",M="negtone",W="negexp",Y="perform") 57 | moderator=list(name="negexp",site=list(c("a","b","c"))) 58 | eq=tripleEquation(labels=labels,moderator=moderator,data=teams,mode=1) 59 | fit=eq2fit(eq,data=teams) 60 | modelsSummary(fit,labels=labels) 61 | labels=list(X="cond",M="pmi",Y="reaction") 62 | modelsSummary(labels=labels,data=pmi) 63 | } 64 | -------------------------------------------------------------------------------- /man/modelsSummary2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary2.R 3 | \name{modelsSummary2} 4 | \alias{modelsSummary2} 5 | \title{Make Summary for Model Coefficients} 6 | \usage{ 7 | modelsSummary2( 8 | fit, 9 | labels = NULL, 10 | prefix = "b", 11 | constant = "iy", 12 | fitlabels = NULL, 13 | autoPrefix = TRUE 14 | ) 15 | } 16 | \arguments{ 17 | \item{fit}{A list of objects of class lm} 18 | 19 | \item{labels}{optional list} 20 | 21 | \item{prefix}{A character} 22 | 23 | \item{constant}{A string vector} 24 | 25 | \item{fitlabels}{Optional. labels of models} 26 | 27 | \item{autoPrefix}{logical} 28 | } 29 | \value{ 30 | A data.frame 31 | } 32 | \description{ 33 | Make Summary for Model Coefficients 34 | } 35 | \examples{ 36 | fit1=lm(mpg~wt,data=mtcars) 37 | fit2=lm(mpg~wt*hp*vs+am,data=mtcars) 38 | labels=list(Y="mpg",X="wt",W="hp",Z="vs") 39 | fit=list(fit1,fit2) 40 | modelsSummary2(fit,labels=labels) 41 | modelsSummary2(fit,labels=labels,prefix=c("c","b"),autoPrefix=FALSE) 42 | modelsSummary2(fit1) 43 | } 44 | -------------------------------------------------------------------------------- /man/modelsSummary2Table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary2.R 3 | \name{modelsSummary2Table} 4 | \alias{modelsSummary2Table} 5 | \title{Make Summary Table 2 for Model Coefficients} 6 | \usage{ 7 | modelsSummary2Table(x, vanilla = TRUE, mode = 1, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modelSummary2} 11 | 12 | \item{vanilla}{A logical} 13 | 14 | \item{mode}{An Integer One of 1:2} 15 | 16 | \item{...}{further arguments to be passed to modelsSummary2()} 17 | } 18 | \description{ 19 | Make Summary Table 2 for Model Coefficients 20 | } 21 | -------------------------------------------------------------------------------- /man/modelsSummaryTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{modelsSummaryTable} 4 | \alias{modelsSummaryTable} 5 | \title{Make Summary Table for Model Coefficients} 6 | \usage{ 7 | modelsSummaryTable(x = NULL, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modelSummary} 11 | 12 | \item{vanilla}{A logical} 13 | 14 | \item{...}{further arguments to be passed to modelsSummary()} 15 | } 16 | \value{ 17 | A flextable 18 | } 19 | \description{ 20 | Make Summary Table for Model Coefficients 21 | } 22 | \examples{ 23 | \donttest{ 24 | fit1=lm(mpg~wt,data=mtcars) 25 | fit2=lm(mpg~wt*hp,data=mtcars) 26 | fit3=lm(mpg~wt*hp*am,data=mtcars) 27 | labels=list(X="wt",W="hp",Y="mpg",Z="am") 28 | x=modelsSummary(fit1,labels=labels) 29 | modelsSummaryTable(x) 30 | modelsSummaryTable(x,vanilla=FALSE) 31 | x=modelsSummary(list(fit1,fit2),labels=labels) 32 | modelsSummaryTable(x) 33 | modelsSummaryTable(x,vanilla=FALSE) 34 | x=modelsSummary(list(fit1,fit2,fit3),labels=labels) 35 | modelsSummaryTable(x) 36 | modelsSummaryTable(x,vanilla=FALSE) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /man/moderator2df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawConcept.R 3 | \name{moderator2df} 4 | \alias{moderator2df} 5 | \title{Make data.frame from a list of moderator} 6 | \usage{ 7 | moderator2df(moderator, mpos = c(0.5, 0.9), vars = NULL, df = NULL) 8 | } 9 | \arguments{ 10 | \item{moderator}{A list} 11 | 12 | \item{mpos}{A numeric vector of length 2} 13 | 14 | \item{vars}{A list} 15 | 16 | \item{df}{A data.frame} 17 | } 18 | \description{ 19 | Make data.frame from a list of moderator 20 | } 21 | \examples{ 22 | moderator=list(name=c("milk","hair"),matrix=list(c(1,1,0,1,0,0,0,0,0,0) 23 | ,c(0,0,0,0,0,0,0,1,0,0))) 24 | moderator2df(moderator) 25 | } 26 | -------------------------------------------------------------------------------- /man/moderator2pos.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{moderator2pos} 4 | \alias{moderator2pos} 5 | \title{get position from moderator} 6 | \usage{ 7 | moderator2pos(moderator = list(), x, y, m) 8 | } 9 | \arguments{ 10 | \item{moderator}{A list} 11 | 12 | \item{x}{position of x} 13 | 14 | \item{y}{position of y} 15 | 16 | \item{m}{position of m} 17 | } 18 | \description{ 19 | get position from moderator 20 | } 21 | -------------------------------------------------------------------------------- /man/modmedEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{modmedEquation} 4 | \alias{modmedEquation} 5 | \title{Make moderated mediation equation} 6 | \usage{ 7 | modmedEquation( 8 | X = "", 9 | M = NULL, 10 | Y = "", 11 | moderator = list(), 12 | labels = NULL, 13 | range = FALSE, 14 | covar = list() 15 | ) 16 | } 17 | \arguments{ 18 | \item{X}{A character vectors indicating independent variables} 19 | 20 | \item{M}{A character vectors indicating mediators} 21 | 22 | \item{Y}{A character vectors indicating dependent variables} 23 | 24 | \item{moderator}{moderator} 25 | 26 | \item{labels}{labels} 27 | 28 | \item{range}{Whether or not add range equation} 29 | 30 | \item{covar}{Optional list of covariates} 31 | } 32 | \description{ 33 | Make moderated mediation equation 34 | } 35 | \examples{ 36 | X="X";Y="Y" 37 | moderator=list(name=c("Z"),site=list(c("a","c"))) 38 | cat(modmedEquation(X=X,Y=Y,moderator=moderator,range=TRUE)) 39 | X="X";M="M";Y="Y" 40 | cat(modmedEquation(X=X,M=M,Y=Y,range=TRUE)) 41 | X="X";M="M";Y="Y" 42 | moderator=list(name=c("Z"),site=list(c("a","c"))) 43 | cat(modmedEquation(X=X,M=M,Y=Y,moderator=moderator,range=TRUE)) 44 | X="X";M="M";Y="Y";labels=NULL;range=FALSE 45 | moderator=list(name=c("X"),site=list(c("b"))) 46 | cat(modmedEquation(X=X,M=M,Y=Y,moderator=moderator,range=FALSE)) 47 | X="X";Y="Y" 48 | moderator=list(name=c("Z"),site=list(c("c"))) 49 | cat(modmedEquation(X=X,Y=Y,moderator=moderator,range=FALSE)) 50 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M","Y"),"Y","Y")) 51 | cat(modmedEquation(X=X,M="M",Y=Y,moderator=moderator,range=FALSE,covar=covar)) 52 | } 53 | -------------------------------------------------------------------------------- /man/modmedSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{modmedSummary} 4 | \alias{modmedSummary} 5 | \title{Summarize the moderated mediation} 6 | \usage{ 7 | modmedSummary( 8 | semfit, 9 | mod = NULL, 10 | values = NULL, 11 | boot.ci.type = "perc", 12 | add.range = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{semfit}{An object of class lavaan} 17 | 18 | \item{mod}{name of moderator} 19 | 20 | \item{values}{Optional. Numeric vector} 21 | 22 | \item{boot.ci.type}{Type of bootstrapping interval. Choices are c("norm","basic","perc",bca.simple")} 23 | 24 | \item{add.range}{logical Whether or not add range} 25 | } 26 | \value{ 27 | A data.frame and an object of class modmedSummary 28 | } 29 | \description{ 30 | Summarize the moderated mediation 31 | } 32 | \examples{ 33 | require(lavaan) 34 | labels=list(X="frame",M="justify",Y="donate",W="skeptic") 35 | moderator=list(name="skeptic",site=list(c("a","c"))) 36 | model=tripleEquation(labels=labels,moderator=moderator) 37 | cat(model) 38 | \donttest{ 39 | semfit=sem(model,data=disaster,se="boot",bootstrap=100) 40 | modmedSummary(semfit) 41 | conditionalEffectPlot(semfit,data=disaster) 42 | labels=list(X="dysfunc",M="negtone",Y="perform",W="negexp") 43 | moderator=list(name="negexp",site=list("b")) 44 | model=tripleEquation(labels=labels,moderator=moderator,data=teams,rangemode=2) 45 | cat(model) 46 | semfit=sem(model,data=teams,se="boot",bootstrap=100) 47 | summary(semfit) 48 | modmedSummary(semfit) 49 | conditionalEffectPlot(semfit,data=teams) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /man/modmedSummary2Table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{modmedSummary2Table} 4 | \alias{modmedSummary2Table} 5 | \title{make table summarizing moderated mediation effect} 6 | \usage{ 7 | modmedSummary2Table(x, vanilla = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class lavaan or modmedSummary2} 11 | 12 | \item{vanilla}{logical.} 13 | 14 | \item{...}{Further arguments to be passed to modmedSummary} 15 | } 16 | \description{ 17 | make table summarizing moderated mediation effect 18 | } 19 | -------------------------------------------------------------------------------- /man/modmedSummaryTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{modmedSummaryTable} 4 | \alias{modmedSummaryTable} 5 | \title{Make a table summarizing the moderated mediation} 6 | \usage{ 7 | modmedSummaryTable(x, vanilla = TRUE, showP = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modmedSummary or class lavaan} 11 | 12 | \item{vanilla}{A logical} 13 | 14 | \item{showP}{logical} 15 | 16 | \item{...}{Further arguments to be passed to modmedSummary} 17 | } 18 | \description{ 19 | Make a table summarizing the moderated mediation 20 | } 21 | -------------------------------------------------------------------------------- /man/moreModels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{moreModels} 5 | \alias{moreModels} 6 | \title{more models data} 7 | \format{ 8 | A data.frame 2 variables 9 | \describe{ 10 | \item{no}{process macro model number} 11 | \item{no1}{model number} 12 | } 13 | } 14 | \usage{ 15 | moreModels 16 | } 17 | \description{ 18 | more models data 19 | } 20 | \keyword{datasets} 21 | -------------------------------------------------------------------------------- /man/myarrow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{myarrow} 4 | \alias{myarrow} 5 | \title{Draw arrow} 6 | \usage{ 7 | myarrow( 8 | from, 9 | to, 10 | lwd = 1, 11 | adjust = 1, 12 | label = "", 13 | label.pos = 0.5, 14 | arr.pos = NULL, 15 | radx = 0.1, 16 | rady = 0.06, 17 | xadj = NULL, 18 | yadj = NULL, 19 | curve = 0, 20 | dd = 0, 21 | ... 22 | ) 23 | } 24 | \arguments{ 25 | \item{from}{coordinates (x,y) of the point *from* which to draw arrow.} 26 | 27 | \item{to}{coordinates (x,y) of the point *to* which to draw arrow.} 28 | 29 | \item{lwd}{line width} 30 | 31 | \item{adjust}{adjust position} 32 | 33 | \item{label}{label} 34 | 35 | \item{label.pos}{label position} 36 | 37 | \item{arr.pos}{arrow position} 38 | 39 | \item{radx}{horizontal radius of the box.} 40 | 41 | \item{rady}{vertical radius of the box.} 42 | 43 | \item{xadj}{numeric x adjustment} 44 | 45 | \item{yadj}{numeric y adjustment} 46 | 47 | \item{curve}{integer relative size of curve (fraction of points distance)} 48 | 49 | \item{dd}{length of segment arm, directed away from endpoints.} 50 | 51 | \item{...}{Further argument to be passed to straightarrow()} 52 | } 53 | \description{ 54 | Draw arrow 55 | } 56 | -------------------------------------------------------------------------------- /man/myarrow2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{myarrow2} 4 | \alias{myarrow2} 5 | \title{Draw arrow with adjustment of a position} 6 | \usage{ 7 | myarrow2( 8 | nodes, 9 | from, 10 | to, 11 | label = "", 12 | no, 13 | radx = 0.12, 14 | rady = 0.04, 15 | xmargin = 0.01, 16 | label.pos = 0.5, 17 | arr.pos = NULL, 18 | addprime = TRUE, 19 | xspace = NULL, 20 | mode = 1, 21 | ... 22 | ) 23 | } 24 | \arguments{ 25 | \item{nodes}{A data.frame} 26 | 27 | \item{from}{coordinates (x,y) of the point *from* which to draw arrow.} 28 | 29 | \item{to}{coordinates (x,y) of the point *to* which to draw arrow.} 30 | 31 | \item{label}{label to display} 32 | 33 | \item{no}{process macro model number} 34 | 35 | \item{radx}{horizontal radius of the box.} 36 | 37 | \item{rady}{vertical radius of the box.} 38 | 39 | \item{xmargin}{horizontal margin of plot} 40 | 41 | \item{label.pos}{label position} 42 | 43 | \item{arr.pos}{arrow position} 44 | 45 | \item{addprime}{logical Whether add prime to label "c"} 46 | 47 | \item{xspace}{numeric horizontal space between nodes} 48 | 49 | \item{mode}{integer mode for adjustxpos} 50 | 51 | \item{...}{Further argument to be passed to straightarrow()} 52 | } 53 | \description{ 54 | Draw arrow with adjustment of a position 55 | } 56 | -------------------------------------------------------------------------------- /man/mycat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makePPTx.R 3 | \name{mycat} 4 | \alias{mycat} 5 | \title{append something to file} 6 | \usage{ 7 | mycat(..., file = "report.Rmd") 8 | } 9 | \arguments{ 10 | \item{...}{Further argument passed to the cat()} 11 | 12 | \item{file}{name of file} 13 | } 14 | \description{ 15 | append something to file 16 | } 17 | -------------------------------------------------------------------------------- /man/mycor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{mycor} 4 | \alias{mycor} 5 | \title{Perform correlation and linear regression for a data.frame} 6 | \usage{ 7 | mycor(x, digits = 3) 8 | } 9 | \arguments{ 10 | \item{x}{A data.frame} 11 | 12 | \item{digits}{integer indicating the number of decimal places} 13 | } 14 | \description{ 15 | Perform correlation and linear regression for a data.frame 16 | } 17 | -------------------------------------------------------------------------------- /man/myflatten.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{myflatten} 4 | \alias{myflatten} 5 | \title{flatten string} 6 | \usage{ 7 | myflatten(x) 8 | } 9 | \arguments{ 10 | \item{x}{character to flatten} 11 | } 12 | \description{ 13 | flatten string 14 | } 15 | -------------------------------------------------------------------------------- /man/myformat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{myformat} 4 | \alias{myformat} 5 | \title{Format a numeric vector} 6 | \usage{ 7 | myformat(x, digits = 3) 8 | } 9 | \arguments{ 10 | \item{x}{A numeric vector} 11 | 12 | \item{digits}{integer indicating the number of decimal places} 13 | } 14 | \description{ 15 | Format a numeric vector 16 | } 17 | -------------------------------------------------------------------------------- /man/mylm.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{mylm} 4 | \alias{mylm} 5 | \title{Correlation and Fitting linear model function for function "mycor"} 6 | \usage{ 7 | mylm(y, x, digits = 3) 8 | } 9 | \arguments{ 10 | \item{y}{numeric vectors of data values} 11 | 12 | \item{x}{numeric vectors of data values} 13 | 14 | \item{digits}{integer indicating the number of decimal places (round) or 15 | significant digits (signif) to be used.} 16 | } 17 | \value{ 18 | mylm returns a list of following components 19 | 20 | \describe{ 21 | \item{out}{a list of class "htest" from \code{\link{cor.test}} 22 | between the last paired samples in a data.frame.} 23 | \item{result}{a numeric vector of length 4, consist of r and p values 24 | from \code{\link{cor.test}},slope and intercept values from 25 | \code{\link{lm}} between numeric vector y and x} 26 | } 27 | } 28 | \description{ 29 | Correlation and Fitting linear model function for function "mycor" 30 | } 31 | -------------------------------------------------------------------------------- /man/nodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{nodes} 5 | \alias{nodes} 6 | \title{Node Data Set for drawing statistical diagram of process macro model} 7 | \format{ 8 | A data.frame with 327 rows and 4 variables 9 | \describe{ 10 | \item{no}{process macro model number} 11 | \item{name}{name of node} 12 | \item{xpos}{x position} 13 | \item{ypos}{y position} 14 | } 15 | } 16 | \usage{ 17 | nodes 18 | } 19 | \description{ 20 | Node Data Set for drawing statistical diagram of process macro model 21 | } 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /man/numberSubscript.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{numberSubscript} 4 | \alias{numberSubscript} 5 | \title{Make number subscript} 6 | \usage{ 7 | numberSubscript(ft, label, vanilla) 8 | } 9 | \arguments{ 10 | \item{ft}{An object of class flextable} 11 | 12 | \item{label}{string vector} 13 | 14 | \item{vanilla}{logical} 15 | } 16 | \description{ 17 | Make number subscript 18 | } 19 | -------------------------------------------------------------------------------- /man/p2asterisk.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{p2asterisk} 4 | \alias{p2asterisk} 5 | \title{Convert p values to asterisk} 6 | \usage{ 7 | p2asterisk(x) 8 | } 9 | \arguments{ 10 | \item{x}{a numeric vector or matrix} 11 | } 12 | \description{ 13 | Convert p values to asterisk 14 | } 15 | -------------------------------------------------------------------------------- /man/p2chr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{p2chr} 4 | \alias{p2chr} 5 | \title{Convert p values to character} 6 | \usage{ 7 | p2chr(x) 8 | } 9 | \arguments{ 10 | \item{x}{A vector} 11 | } 12 | \description{ 13 | Convert p values to character 14 | } 15 | -------------------------------------------------------------------------------- /man/parallelMatrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{parallelMatrix} 4 | \alias{parallelMatrix} 5 | \title{Make bmatrix for parallel multiple mediator model} 6 | \usage{ 7 | parallelMatrix(n = 2) 8 | } 9 | \arguments{ 10 | \item{n}{integer number of mediator} 11 | } 12 | \description{ 13 | Make bmatrix for parallel multiple mediator model 14 | } 15 | \examples{ 16 | parallelMatrix(3) 17 | } 18 | -------------------------------------------------------------------------------- /man/parrows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{parrows} 5 | \alias{parrows} 6 | \title{Arrow Data Set for drawing statistical diagram of process macro model} 7 | \format{ 8 | A data.frame with 392 rows and 6 variables 9 | \describe{ 10 | \item{no}{process macro model number} 11 | \item{name}{name of arrow} 12 | \item{start}{start node} 13 | \item{end}{end node} 14 | \item{labelpos}{position of label} 15 | \item{arrowpos}{position of arrow head} 16 | } 17 | } 18 | \usage{ 19 | parrows 20 | } 21 | \description{ 22 | Arrow Data Set for drawing statistical diagram of process macro model 23 | } 24 | \keyword{datasets} 25 | -------------------------------------------------------------------------------- /man/pastecolon.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CorPlot.R 3 | \name{pastecolon} 4 | \alias{pastecolon} 5 | \title{paste two character with colon} 6 | \usage{ 7 | pastecolon(temp, x) 8 | } 9 | \arguments{ 10 | \item{temp}{a character} 11 | 12 | \item{x}{a character} 13 | } 14 | \description{ 15 | paste two character with colon 16 | } 17 | -------------------------------------------------------------------------------- /man/pformat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{pformat} 4 | \alias{pformat} 5 | \title{Make p value format} 6 | \usage{ 7 | pformat(x) 8 | } 9 | \arguments{ 10 | \item{x}{A numeric vector} 11 | } 12 | \description{ 13 | Make p value format 14 | } 15 | -------------------------------------------------------------------------------- /man/plot.mediationBK.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mediationBK.R 3 | \name{plot.mediationBK} 4 | \alias{plot.mediationBK} 5 | \title{S3 method for class mediationBK} 6 | \usage{ 7 | \method{plot}{mediationBK}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class mediationBK} 11 | 12 | \item{...}{Further arguments to be passed to plot()} 13 | } 14 | \description{ 15 | S3 method for class mediationBK 16 | } 17 | \examples{ 18 | labels=list(X="cond",M="pmi",Y="reaction") 19 | result=mediationBK(labels=labels,data=pmi) 20 | plot(result,type=1) 21 | plot(result) 22 | plot(result,type=1,whatLabel="label",arrowslabels="c",addprime=FALSE) 23 | plot(result,whatLabel="label",arrowslabels=c("a","b","c")) 24 | } 25 | -------------------------------------------------------------------------------- /man/plotCoef.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlot.R 3 | \name{plotCoef} 4 | \alias{plotCoef} 5 | \title{Make Slopes Plot} 6 | \usage{ 7 | plotCoef(ss, color = "deepskyblue2", size = 0.75, digits = 1) 8 | } 9 | \arguments{ 10 | \item{ss}{An object of class sim_slopes} 11 | 12 | \item{color}{Name of color} 13 | 14 | \item{size}{size of pointrange} 15 | 16 | \item{digits}{An integer indicating the number of decimal places} 17 | } 18 | \value{ 19 | A ggplot 20 | } 21 | \description{ 22 | Make Slopes Plot 23 | } 24 | -------------------------------------------------------------------------------- /man/pmacro.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{pmacro} 5 | \alias{pmacro} 6 | \title{Data Set for process macro model} 7 | \format{ 8 | A data.frame with 43 rows and 7 variables 9 | \describe{ 10 | \item{no}{process macro model number} 11 | \item{X}{name of independent variable} 12 | \item{M}{names of mediator variables} 13 | \item{Y}{name of dependent variable} 14 | \item{modName}{names of moderator variables} 15 | \item{modSite}{sites of moderators} 16 | \item{pos}{position of moderators} 17 | } 18 | } 19 | \usage{ 20 | pmacro 21 | } 22 | \description{ 23 | Data Set for process macro model 24 | } 25 | \keyword{datasets} 26 | -------------------------------------------------------------------------------- /man/pmacroModel.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pmacroModel.R 3 | \name{pmacroModel} 4 | \alias{pmacroModel} 5 | \title{draw conceptual diagram of process macro model} 6 | \usage{ 7 | pmacroModel( 8 | no = 1, 9 | labels = list(), 10 | covar = list(), 11 | radx = 0.06, 12 | rady = 0.06, 13 | xmargin = 0.03, 14 | box.col = "white", 15 | xlim = NULL, 16 | ylim = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{no}{process macro model number} 21 | 22 | \item{labels}{A character list} 23 | 24 | \item{covar}{A optional list of covariates} 25 | 26 | \item{radx}{horizontal radius of the box.} 27 | 28 | \item{rady}{vertical radius of the box.} 29 | 30 | \item{xmargin}{horizontal margin of plot} 31 | 32 | \item{box.col}{fill color of box} 33 | 34 | \item{xlim}{the x limits (min,max) of the plot} 35 | 36 | \item{ylim}{the y limits (min,max) of the plot} 37 | } 38 | \description{ 39 | draw conceptual diagram of process macro model 40 | } 41 | \examples{ 42 | pmacroModel(1) 43 | covar=list(name=c("C1","C2"),label=c("ese","sex","tenure"),site=list("Y","Y")) 44 | pmacroModel(1,covar=covar) 45 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list("M",c("Mi","Y"),c("Y"))) 46 | pmacroModel(4,covar=covar) 47 | } 48 | -------------------------------------------------------------------------------- /man/pmi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{pmi} 5 | \alias{pmi} 6 | \title{PMI: Presumed Media Influence dataset} 7 | \format{ 8 | A data.frame with 123 obs. of 6 variables 9 | \describe{ 10 | \item{cond}{front (1) or interior (0) page of the newspaper} 11 | \item{pmi}{presumed media influence} 12 | \item{import}{article is on an important topic} 13 | \item{reaction}{sugar purchase} 14 | \item{gender}{GENDER: female (0) or male (1)} 15 | \item{age}{age} 16 | } 17 | } 18 | \source{ 19 | Tal-Or, N., Cohen, J., Tsafati, Y., & Gunther, A. C. (2010). Testing causal direction in the influence of presumed media influence. Communication Research, 37, 801-824. 20 | 21 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 22 | } 23 | \usage{ 24 | pmi 25 | } 26 | \description{ 27 | PMI: Presumed Media Influence dataset 28 | } 29 | \keyword{datasets} 30 | -------------------------------------------------------------------------------- /man/print.compareVIF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{print.compareVIF} 4 | \alias{print.compareVIF} 5 | \title{S3 method of class compareVIF} 6 | \usage{ 7 | \method{print}{compareVIF}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class compareVIF} 11 | 12 | \item{...}{Further arguments to be passed to print} 13 | } 14 | \description{ 15 | S3 method of class compareVIF 16 | } 17 | -------------------------------------------------------------------------------- /man/print.meanSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/meanSummary.R 3 | \name{print.meanSummary} 4 | \alias{print.meanSummary} 5 | \title{S3 method of class meanSummary} 6 | \usage{ 7 | \method{print}{meanSummary}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class meanSummary} 11 | 12 | \item{...}{Further arguments to be passed to print()} 13 | } 14 | \description{ 15 | S3 method of class meanSummary 16 | } 17 | -------------------------------------------------------------------------------- /man/print.medSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{print.medSummary} 4 | \alias{print.medSummary} 5 | \title{S3 method print for an object of class medSummary} 6 | \usage{ 7 | \method{print}{medSummary}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class medSummary} 11 | 12 | \item{...}{additional arguments to pass to print.medSummary} 13 | } 14 | \description{ 15 | S3 method print for an object of class medSummary 16 | } 17 | -------------------------------------------------------------------------------- /man/print.medSummary2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{print.medSummary2} 4 | \alias{print.medSummary2} 5 | \title{S3 method print for an object of class medSummary2} 6 | \usage{ 7 | \method{print}{medSummary2}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class medSummary} 11 | 12 | \item{...}{additional arguments to pass to print.medSummary} 13 | } 14 | \description{ 15 | S3 method print for an object of class medSummary2 16 | } 17 | -------------------------------------------------------------------------------- /man/print.mediationBK.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mediationBK.R 3 | \name{print.mediationBK} 4 | \alias{print.mediationBK} 5 | \title{S3 method for class mediationBK} 6 | \usage{ 7 | \method{print}{mediationBK}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class mediationBK} 11 | 12 | \item{...}{Further arguments to be passed to print()} 13 | } 14 | \description{ 15 | S3 method for class mediationBK 16 | } 17 | -------------------------------------------------------------------------------- /man/print.modSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modSummary.R 3 | \name{print.modSummary} 4 | \alias{print.modSummary} 5 | \title{S3 method of class modSummary} 6 | \usage{ 7 | \method{print}{modSummary}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modSummary} 11 | 12 | \item{...}{Further arguments to be passed to print} 13 | } 14 | \description{ 15 | S3 method of class modSummary 16 | } 17 | -------------------------------------------------------------------------------- /man/print.modelSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary.R 3 | \name{print.modelSummary} 4 | \alias{print.modelSummary} 5 | \title{S3 method print for object modelSummary} 6 | \usage{ 7 | \method{print}{modelSummary}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Object of class modelSummary} 11 | 12 | \item{...}{additional arguments to pass to print.modelSummary} 13 | } 14 | \description{ 15 | S3 method print for object modelSummary 16 | } 17 | -------------------------------------------------------------------------------- /man/print.modelSummary2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modelsSummary2.R 3 | \name{print.modelSummary2} 4 | \alias{print.modelSummary2} 5 | \title{S3 method print for object modelSummary2} 6 | \usage{ 7 | \method{print}{modelSummary2}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Object of class modelSummary} 11 | 12 | \item{...}{additional arguments to pass to print.modelSummary} 13 | } 14 | \description{ 15 | S3 method print for object modelSummary2 16 | } 17 | -------------------------------------------------------------------------------- /man/print.modmedSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{print.modmedSummary} 4 | \alias{print.modmedSummary} 5 | \title{S3 method print for an object of class modmedSummary} 6 | \usage{ 7 | \method{print}{modmedSummary}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modmedSummary} 11 | 12 | \item{...}{additional arguments to pass to print.modmedSummary} 13 | } 14 | \description{ 15 | S3 method print for an object of class modmedSummary 16 | } 17 | -------------------------------------------------------------------------------- /man/print.modmedSummary2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{print.modmedSummary2} 4 | \alias{print.modmedSummary2} 5 | \title{S3 method print for an object of class modmedSummary2} 6 | \usage{ 7 | \method{print}{modmedSummary2}(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modmedSummary2} 11 | 12 | \item{...}{additional arguments to pass to print.modmedSummary2} 13 | } 14 | \description{ 15 | S3 method print for an object of class modmedSummary2 16 | } 17 | -------------------------------------------------------------------------------- /man/productEq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat2.R 3 | \name{productEq} 4 | \alias{productEq} 5 | \title{Make products of equations} 6 | \usage{ 7 | productEq(equation1, equation2) 8 | } 9 | \arguments{ 10 | \item{equation1}{The first equation} 11 | 12 | \item{equation2}{The second equation} 13 | } 14 | \description{ 15 | Make products of equations 16 | } 17 | \examples{ 18 | equation1=c("a1+b1*W") 19 | equation2=c("a2+b2*W") 20 | productEq(equation1,equation2) 21 | } 22 | -------------------------------------------------------------------------------- /man/protest.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{protest} 5 | \alias{protest} 6 | \title{Protest dataset} 7 | \format{ 8 | A data.frame with 129 rows and 6 variables 9 | \describe{ 10 | \item{subnum}{subject number} 11 | \item{protest}{experimental condition, 0 = no protest, 1 = individual protest, 2 = group protest} 12 | \item{sexism}{perceived pervasiveness of sex discrimination. Means of an 8 item Modern Sexism Scale.} 13 | \item{angry}{anger toward the attorney. “I feel angry towards Catherine".} 14 | \item{liking}{liking of the attorney. Mean rating of 6 liking ratings of the target.} 15 | \item{respappr}{appropriateness of response. Mean of four items of appropriateness of the target's response.} 16 | } 17 | } 18 | \source{ 19 | Garcia, D. M., Schmitt, M. T., Branscombe, N. R., & Ellemers, N. (2010). Women's reactions to ingroup members who protest discriminatory treatment: The importance of beliefs about inequality and response appropriateness. European Journal of Social Psychology, 40, 733-745. 20 | 21 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 22 | } 23 | \usage{ 24 | protest 25 | } 26 | \description{ 27 | Garcia, Schmitt, Branscombe, and Ellemers (2010) report data for 129 subjects on the effects of perceived sexism on anger and liking of women's reactions to ingroup members who protest discrimination. This data set is also used as the ‘protest’ data set by Hayes (2013 and 2018). It is a useful example of mediation and moderation in regression. It may also be used as an example of plotting interactions. 28 | } 29 | \details{ 30 | The reaction of women to women who protest discriminatory treatment was examined in an experiment reported by Garcia et al. (2010). 129 women were given a description of sex discrimination in the workplace (a male lawyer was promoted over a clearly more qualified female lawyer). Subjects then read that the target lawyer felt that the decision was unfair. Subjects were then randomly assigned to three conditions: Control (no protest), Individual Protest (“They are treating me unfairly") , or Collective Protest (“The firm is is treating women unfairly"). 31 | Participants were then asked how much they liked the target (liking), how angry they were to the target (anger) and to evaluate the appropriateness of the target's response (respappr). 32 | Garcia et al(2010) report a number of interactions (moderation effects) as well as moderated-mediation effects. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /man/qqPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/densityPlot.R 3 | \name{qqPlot} 4 | \alias{qqPlot} 5 | \title{Draw quantile-quantile plot} 6 | \usage{ 7 | qqPlot(x, linecolor = "red", xlab = NULL, ylab = NULL, title = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{A numeric vector} 11 | 12 | \item{linecolor}{character line color} 13 | 14 | \item{xlab}{character label for x axis} 15 | 16 | \item{ylab}{character label for y axis} 17 | 18 | \item{title}{character label for plot title} 19 | 20 | \item{...}{Further arguments to be passed to geom_qq()} 21 | } 22 | \description{ 23 | Draw quantile-quantile plot 24 | } 25 | \examples{ 26 | qqPlot(rnorm(200)) 27 | qqPlot(rt(200, df = 5)) 28 | } 29 | -------------------------------------------------------------------------------- /man/r2diff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/r2diff.R 3 | \name{r2diff} 4 | \alias{r2diff} 5 | \title{Calculate difference of R2 and adjusted R2} 6 | \usage{ 7 | r2diff(fit, mode = 1, digits = 3) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of class lm} 11 | 12 | \item{mode}{Integer If 1, remove all interaction. If 2, remove variables one by one} 13 | 14 | \item{digits}{Integer indicating the number of decimal places} 15 | } 16 | \description{ 17 | Calculate difference of R2 and adjusted R2 18 | } 19 | \examples{ 20 | fit=lm(mpg~wt*hp,data=mtcars) 21 | r2diff(fit) 22 | r2diff(fit,mode=2) 23 | } 24 | -------------------------------------------------------------------------------- /man/r2pptx.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makePPTx.R 3 | \name{r2pptx} 4 | \alias{r2pptx} 5 | \title{Make powerpoint presentation from R file} 6 | \usage{ 7 | r2pptx( 8 | file, 9 | filename = "report.pptx", 10 | keyword = c("Concept", "Diagram", "Model", "Plot", "plot", "Table", "summary"), 11 | rmdRemove = TRUE 12 | ) 13 | } 14 | \arguments{ 15 | \item{file}{source file name} 16 | 17 | \item{filename}{destination file name} 18 | 19 | \item{keyword}{A string vector} 20 | 21 | \item{rmdRemove}{A logical} 22 | } 23 | \description{ 24 | Make powerpoint presentation from R file 25 | } 26 | -------------------------------------------------------------------------------- /man/regEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/regEquation.R 3 | \name{regEquation} 4 | \alias{regEquation} 5 | \title{Make regression equation} 6 | \usage{ 7 | regEquation( 8 | X = "X", 9 | M = NULL, 10 | Y = "Y", 11 | moderator = list(), 12 | covar = list(), 13 | secondIndirect = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{X}{A character vectors indicating independent variables} 18 | 19 | \item{M}{A character vectors indicating mediators} 20 | 21 | \item{Y}{A character vectors indicating dependent variables} 22 | 23 | \item{moderator}{moderator} 24 | 25 | \item{covar}{covariates} 26 | 27 | \item{secondIndirect}{A logical} 28 | } 29 | \description{ 30 | Make regression equation 31 | } 32 | \examples{ 33 | X="X";M=NULL;Y="Y"; moderator=list(name="W",site=list("c")) 34 | regEquation(X,M,Y,moderator) 35 | M=c("M1","M2") 36 | regEquation(X,M,Y,moderator,secondIndirect=TRUE) 37 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M1","Y"),"Y","Y")) 38 | regEquation(X,M,Y,moderator,covar=covar) 39 | covar=list(name=c("ese","sex","tenure"),site=list(c("M","Y"),c("M","Y"),c("M","Y"))) 40 | regEquation(X="estress",M="affect",Y="withdraw",covar=covar) 41 | } 42 | -------------------------------------------------------------------------------- /man/reliabilityTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{reliabilityTable} 4 | \alias{reliabilityTable} 5 | \title{make reliability Table} 6 | \usage{ 7 | reliabilityTable(fit) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of a class lavaan} 11 | } 12 | \description{ 13 | make reliability Table 14 | } 15 | -------------------------------------------------------------------------------- /man/reliabilityTable2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/reliabilityTable.R 3 | \name{reliabilityTable2} 4 | \alias{reliabilityTable2} 5 | \title{make reliability Table in flextable format} 6 | \usage{ 7 | reliabilityTable2(fit, vanilla = FALSE) 8 | } 9 | \arguments{ 10 | \item{fit}{An object of a class lavaan} 11 | 12 | \item{vanilla}{Logical} 13 | } 14 | \description{ 15 | make reliability Table in flextable format 16 | } 17 | -------------------------------------------------------------------------------- /man/removeParentheses.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{removeParentheses} 4 | \alias{removeParentheses} 5 | \title{Remove parentheses} 6 | \usage{ 7 | removeParentheses(string) 8 | } 9 | \arguments{ 10 | \item{string}{A character vector} 11 | } 12 | \description{ 13 | Remove parentheses 14 | } 15 | -------------------------------------------------------------------------------- /man/rightPrint.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedSummary.R 3 | \name{rightPrint} 4 | \alias{rightPrint} 5 | \title{Print a string in right alignment} 6 | \usage{ 7 | rightPrint(string, width) 8 | } 9 | \arguments{ 10 | \item{string}{A string} 11 | 12 | \item{width}{A numeric} 13 | } 14 | \description{ 15 | Print a string in right alignment 16 | } 17 | -------------------------------------------------------------------------------- /man/seekGroup.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{seekGroup} 4 | \alias{seekGroup} 5 | \title{Find group with variable name} 6 | \usage{ 7 | seekGroup(var, res, group) 8 | } 9 | \arguments{ 10 | \item{var}{A string to seek} 11 | 12 | \item{res}{A data.frame. Result of parameterEstimates function of package lavaan or subset.} 13 | 14 | \item{group}{A string vector} 15 | } 16 | \description{ 17 | Find group with variable name 18 | } 19 | -------------------------------------------------------------------------------- /man/seekGroup1.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{seekGroup1} 4 | \alias{seekGroup1} 5 | \title{Find group with variable name} 6 | \usage{ 7 | seekGroup1(var, res) 8 | } 9 | \arguments{ 10 | \item{var}{A string to seek} 11 | 12 | \item{res}{A data.frame. Result of parameterEstimates function of package lavaan or subset.} 13 | } 14 | \description{ 15 | Find group with variable name 16 | } 17 | -------------------------------------------------------------------------------- /man/seekGroup2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{seekGroup2} 4 | \alias{seekGroup2} 5 | \title{Find group with variable name} 6 | \usage{ 7 | seekGroup2(var, res, group) 8 | } 9 | \arguments{ 10 | \item{var}{A string to seek} 11 | 12 | \item{res}{A data.frame. Result of parameterEstimates function of package lavaan or subset.} 13 | 14 | \item{group}{A character vector} 15 | } 16 | \description{ 17 | Find group with variable name 18 | } 19 | -------------------------------------------------------------------------------- /man/seekNameVars.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{seekNameVars} 4 | \alias{seekNameVars} 5 | \title{select names of variables from list var} 6 | \usage{ 7 | seekNameVars(vars, site = "a") 8 | } 9 | \arguments{ 10 | \item{vars}{A list} 11 | 12 | \item{site}{Site for look for} 13 | } 14 | \description{ 15 | select names of variables from list var 16 | } 17 | \examples{ 18 | vars=list(name=list(c("W","Z"),c("V","Q")),site=list(c("a","c"),c("b","c"))) 19 | vars=list(name=list(c("W","Z")),site=list(c("a","c"))) 20 | seekNameVars(vars,"a") 21 | seekNameVars(vars,"b") 22 | seekNameVars(vars,"c") 23 | } 24 | -------------------------------------------------------------------------------- /man/seekVar.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/makeEquation.R 3 | \name{seekVar} 4 | \alias{seekVar} 5 | \title{Seek var form covariates} 6 | \usage{ 7 | seekVar( 8 | covar = list(), 9 | var, 10 | prefix = "h", 11 | start = 1, 12 | grouplabels = NULL, 13 | suffix = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{covar}{A list of covariates} 18 | 19 | \item{var}{A name of variable to look for} 20 | 21 | \item{prefix}{A prefix} 22 | 23 | \item{start}{A start number} 24 | 25 | \item{grouplabels}{A list} 26 | 27 | \item{suffix}{A suffix} 28 | } 29 | \description{ 30 | Seek var form covariates 31 | } 32 | \examples{ 33 | covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M","Y"),"Y","Y")) 34 | var="Y" 35 | seekVar(covar,var,prefix="h") 36 | } 37 | -------------------------------------------------------------------------------- /man/separateEq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat2.R 3 | \name{separateEq} 4 | \alias{separateEq} 5 | \title{Separate equation} 6 | \usage{ 7 | separateEq(equation) 8 | } 9 | \arguments{ 10 | \item{equation}{string. Equations to separate} 11 | } 12 | \description{ 13 | Separate equation 14 | } 15 | \examples{ 16 | equation="( a1 + b1 * W )" 17 | separateEq(equation) 18 | } 19 | -------------------------------------------------------------------------------- /man/setPositionNodes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawModel.R 3 | \name{setPositionNodes} 4 | \alias{setPositionNodes} 5 | \title{Set Position of nodes} 6 | \usage{ 7 | setPositionNodes( 8 | nodes, 9 | arrows, 10 | radx = 0.08, 11 | rady = 0.06, 12 | xmargin = 0.02, 13 | ymargin = 0.02, 14 | xlim = c(-0.3, 1.35), 15 | ylim = c(-0.07, 1.05), 16 | parallel2 = FALSE, 17 | parallel3 = FALSE 18 | ) 19 | } 20 | \arguments{ 21 | \item{nodes}{A data.frame of nodes} 22 | 23 | \item{arrows}{A data.frame of arrows} 24 | 25 | \item{radx}{horizontal radius of the box.} 26 | 27 | \item{rady}{vertical radius of the box.} 28 | 29 | \item{xmargin}{horizontal margin between nodes} 30 | 31 | \item{ymargin}{vertical margin between nodes} 32 | 33 | \item{xlim}{the x limits (min,max) of the plot} 34 | 35 | \item{ylim}{the y limits (min,max) of the plot} 36 | 37 | \item{parallel2}{logical} 38 | 39 | \item{parallel3}{logical} 40 | } 41 | \description{ 42 | Set Position of nodes 43 | } 44 | -------------------------------------------------------------------------------- /man/showModels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/showModels.R 3 | \name{showModels} 4 | \alias{showModels} 5 | \title{Run process macro shiny app} 6 | \usage{ 7 | showModels() 8 | } 9 | \description{ 10 | Run process macro shiny app 11 | } 12 | -------------------------------------------------------------------------------- /man/standardize.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{standardize} 4 | \alias{standardize} 5 | \title{Standardize variable} 6 | \usage{ 7 | standardize(x) 8 | } 9 | \arguments{ 10 | \item{x}{A numeric vector} 11 | } 12 | \description{ 13 | Standardize variable 14 | } 15 | -------------------------------------------------------------------------------- /man/standardizeDf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{standardizeDf} 4 | \alias{standardizeDf} 5 | \title{standardize data} 6 | \usage{ 7 | standardizeDf(df, names) 8 | } 9 | \arguments{ 10 | \item{df}{A data.frame} 11 | 12 | \item{names}{column names to mean centering} 13 | } 14 | \description{ 15 | standardize data 16 | } 17 | -------------------------------------------------------------------------------- /man/statisticalDiagram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statisticalDiagram.R 3 | \name{statisticalDiagram} 4 | \alias{statisticalDiagram} 5 | \title{Draw statistical diagram} 6 | \usage{ 7 | statisticalDiagram( 8 | no = 1, 9 | radx = 0.1, 10 | rady = 0.04, 11 | xmargin = 0.01, 12 | arrowlabel = TRUE, 13 | arrowslabels = NULL, 14 | arrowslty = NULL, 15 | labels = list(), 16 | nodeslabels = list(), 17 | whatLabel = "name", 18 | fit = NULL, 19 | estimatesTable = NULL, 20 | digits = 3, 21 | covar = list(), 22 | addCovar = TRUE, 23 | type = NULL, 24 | includeLatentVars = FALSE, 25 | addprime = TRUE, 26 | box.col = "white", 27 | xlim = c(0, 1), 28 | ylim = NULL 29 | ) 30 | } 31 | \arguments{ 32 | \item{no}{process macro model number} 33 | 34 | \item{radx}{horizontal radius of the box.} 35 | 36 | \item{rady}{vertical radius of the box.} 37 | 38 | \item{xmargin}{horizontal margin of plot} 39 | 40 | \item{arrowlabel}{logical whether or not draw arrowlabel} 41 | 42 | \item{arrowslabels}{A character vector} 43 | 44 | \item{arrowslty}{linetype of arrows} 45 | 46 | \item{labels}{A list of character string} 47 | 48 | \item{nodeslabels}{A list of character string} 49 | 50 | \item{whatLabel}{What should the edge labels indicate in the path diagram? Choices are c("est","std","name","label")} 51 | 52 | \item{fit}{A list of class lm or an object of class lavaan} 53 | 54 | \item{estimatesTable}{A data.frame} 55 | 56 | \item{digits}{Integer indicating the number of decimal places} 57 | 58 | \item{covar}{Optional list of covariates} 59 | 60 | \item{addCovar}{Logical. Whether or not include covariates} 61 | 62 | \item{type}{An integer} 63 | 64 | \item{includeLatentVars}{A logical} 65 | 66 | \item{addprime}{logical. Whether or not add prime to label "c"} 67 | 68 | \item{box.col}{fill color of the box} 69 | 70 | \item{xlim}{the x limits (min,max) of the plot} 71 | 72 | \item{ylim}{the y limits (min,max) of the plot} 73 | } 74 | \description{ 75 | Draw statistical diagram 76 | } 77 | \examples{ 78 | statisticalDiagram(no=1) 79 | covar=list(name=c("posemot","ideology","sex"),site=list(c("Y"),c("Y"),c("Y"))) 80 | statisticalDiagram(no=1,covar=covar) 81 | covar=list(name=c("posemot","ideology","sex"),site=list(c("M","Y"),c("Mi","Y"),c("Mi","Y"))) 82 | covar=list(name=c("C1","C2"),site=list(c("M","Y"),"Y")) 83 | statisticalDiagram(no=4,covar=covar) 84 | statisticalDiagram(no=8,covar=covar) 85 | labels=list(X="wintense",Mi="cogapp",Y="emotion") 86 | nodeslabels=list(X="Work\nIntensity",Mi="Cognitive\nAppraisal",Y="Emotional\nExhaustion") 87 | statisticalDiagram(4,labels=labels) 88 | statisticalDiagram(4,labels=nodeslabels) 89 | statisticalDiagram(4,labels=labels,nodeslabels=nodeslabels) 90 | labels=list(X="GDP\nper inhabitant",M="Illiteracy Rate",Y="Mean Life\nExpectation") 91 | statisticalDiagram(4,labels=labels) 92 | statisticalDiagram(4,labels=labels,arrowslabels=c("e","f","g"),whatLabel="label") 93 | } 94 | -------------------------------------------------------------------------------- /man/str2vector.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{str2vector} 4 | \alias{str2vector} 5 | \title{Make character vector from string} 6 | \usage{ 7 | str2vector(string = "a,b,c") 8 | } 9 | \arguments{ 10 | \item{string}{string} 11 | } 12 | \description{ 13 | Make character vector from string 14 | } 15 | -------------------------------------------------------------------------------- /man/strGrouping.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{strGrouping} 4 | \alias{strGrouping} 5 | \title{Make Grouping equation} 6 | \usage{ 7 | strGrouping(x, groupby = "X") 8 | } 9 | \arguments{ 10 | \item{x}{character vector} 11 | 12 | \item{groupby}{name of groupby} 13 | } 14 | \description{ 15 | Make Grouping equation 16 | } 17 | -------------------------------------------------------------------------------- /man/str_detect2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modmedEquation.R 3 | \name{str_detect2} 4 | \alias{str_detect2} 5 | \title{Extension of str_detect to list} 6 | \usage{ 7 | str_detect2(list, pattern) 8 | } 9 | \arguments{ 10 | \item{list}{a list} 11 | 12 | \item{pattern}{pattern to look for} 13 | } 14 | \description{ 15 | Extension of str_detect to list 16 | } 17 | \examples{ 18 | site=list(c("a","c"),c("a","b","c")) 19 | str_detect2(site,"b") 20 | } 21 | -------------------------------------------------------------------------------- /man/str_setdiff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/conceptDiagram.R 3 | \name{str_setdiff} 4 | \alias{str_setdiff} 5 | \title{Remove matched pattern from string} 6 | \usage{ 7 | str_setdiff(string = "a,c", pattern = "a") 8 | } 9 | \arguments{ 10 | \item{string}{string} 11 | 12 | \item{pattern}{pattern to look for} 13 | } 14 | \description{ 15 | Remove matched pattern from string 16 | } 17 | -------------------------------------------------------------------------------- /man/sumEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/catMediation.R 3 | \name{sumEquation} 4 | \alias{sumEquation} 5 | \title{summation of equations} 6 | \usage{ 7 | sumEquation(eq1, eq2) 8 | } 9 | \arguments{ 10 | \item{eq1}{A equation} 11 | 12 | \item{eq2}{A equation} 13 | } 14 | \description{ 15 | summation of equations 16 | } 17 | -------------------------------------------------------------------------------- /man/summary.mediationBK.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/mediationBK.R 3 | \name{summary.mediationBK} 4 | \alias{summary.mediationBK} 5 | \title{S3 method for class mediationBK} 6 | \usage{ 7 | \method{summary}{mediationBK}(object, ...) 8 | } 9 | \arguments{ 10 | \item{object}{An object of class mediationBK} 11 | 12 | \item{...}{Further arguments to be passed to summary()} 13 | } 14 | \description{ 15 | S3 method for class mediationBK 16 | } 17 | -------------------------------------------------------------------------------- /man/teachers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/teachers.R 3 | \docType{data} 4 | \name{teachers} 5 | \alias{teachers} 6 | \title{Teacher Efficacy Data} 7 | \format{ 8 | A data.frame with 247 rows and 7 variables: 9 | \describe{ 10 | \item{age}{teacher's age. 1: 20-24, 2: 25-29, 3: 30-34, 4: 35-39, 5: 40-44, 6:45-49, 7: 50 or above } 11 | \item{marriage}{Marital Status. 0: single, 2: married} 12 | \item{children}{Parental Status. 0: no children, 1: one or more children} 13 | \item{wellbeing}{Psychological Well-being} 14 | \item{stress}{Job stress. A response syndrome of negative affects(such as anger or depression) resulting from the teacher's job} 15 | \item{efficacy}{Teacher Efficacy. A judgement of his or her capabilities to bring about desired outcomes of student engagement and learning} 16 | \item{support}{Social Support. Various resources provided by ones's interpersonal ties.} 17 | } 18 | } 19 | \source{ 20 | {Cohen, S., & Hoberman, H. M. (1983). Positive events and social support as butters of life change stress. Journal of Social Applied Psychology, 13, 99-125} 21 | 22 | {Tschannen-Moran, M., & Hoy, A. W. (2001). Teacher efficacy: Capturing an elusive construct. Teaching and teacher education, 17(7), 783-805} 23 | 24 | {Ryff, Carol D. (1989). Happiness Is Everything, or Is It? Explorationson the Meaning of Psychological Well-Being. Journal of-Personality and Social Psychology, 57, 1069-1081} 25 | 26 | {Kyriacou, C., & Sutcliffe, J. (1978). Teacher stress: Prevalence, sources, and symptoms. British Journal of Educational Psychology, 55, 61-64} 27 | } 28 | \usage{ 29 | teachers 30 | } 31 | \description{ 32 | A dataset containing teacher efficacy, social support, psychological wellbeing and job stress of 247 teachers working in kindergarten 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /man/teams.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/education.R 3 | \docType{data} 4 | \name{teams} 5 | \alias{teams} 6 | \title{Teams data set} 7 | \format{ 8 | A data.frame with 60 rows and 4 variables 9 | \describe{ 10 | \item{dysfunc}{Dysfunctional team behavior} 11 | \item{negtone}{Negative affective tone} 12 | \item{negexp}{Negative expressivity} 13 | \item{perform}{Team performance} 14 | } 15 | } 16 | \source{ 17 | Cole, M. S., Walter, F., & Bruch, H. (2008). Affective mechanisms linking dysfunctional behavior to performance in work teams: A moderated mediation study. Journal of Applied Psychology, 93, 945-958. 18 | 19 | \url{http://www.afhayes.com/introduction-to-mediation-moderation-and-conditional-process-analysis.html} 20 | } 21 | \usage{ 22 | teams 23 | } 24 | \description{ 25 | Teams data set 26 | } 27 | \keyword{datasets} 28 | -------------------------------------------------------------------------------- /man/theme_clean2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{theme_clean2} 4 | \alias{theme_clean2} 5 | \title{Clean theme for ggCor} 6 | \usage{ 7 | theme_clean2(base_size = 12, xangle = 45, yangle = 0) 8 | } 9 | \arguments{ 10 | \item{base_size}{base font size} 11 | 12 | \item{xangle}{x-axis text angle} 13 | 14 | \item{yangle}{y-axis text angle} 15 | } 16 | \description{ 17 | Clean theme for ggCor 18 | } 19 | -------------------------------------------------------------------------------- /man/treatInteraction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/multipleMediation.R 3 | \name{treatInteraction} 4 | \alias{treatInteraction} 5 | \title{unfold interaction} 6 | \usage{ 7 | treatInteraction(var) 8 | } 9 | \arguments{ 10 | \item{var}{name of variables} 11 | } 12 | \description{ 13 | unfold interaction 14 | } 15 | \examples{ 16 | var="X*M" 17 | treatInteraction(var) 18 | var="X*M*W" 19 | treatInteraction(var) 20 | } 21 | -------------------------------------------------------------------------------- /man/treatModerator.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{treatModerator} 4 | \alias{treatModerator} 5 | \title{Treat moderator name with mean value} 6 | \usage{ 7 | treatModerator( 8 | ind, 9 | moderatorNames, 10 | data = NULL, 11 | rangemode = 1, 12 | probs = c(0.16, 0.5, 0.84) 13 | ) 14 | } 15 | \arguments{ 16 | \item{ind}{An equation} 17 | 18 | \item{moderatorNames}{character vectors} 19 | 20 | \item{data}{A data.frame} 21 | 22 | \item{rangemode}{range mode} 23 | 24 | \item{probs}{numeric vector of probabilities with values in [0,1]} 25 | } 26 | \description{ 27 | Treat moderator name with mean value 28 | } 29 | \examples{ 30 | ind="(a1+a4*sex+a5*age)*(b1)" 31 | moderatorNames=c("age","sex") 32 | treatModerator(ind,moderatorNames) 33 | ind="c1+c3*hp" 34 | moderatorNames="hp" 35 | treatModerator(ind,moderatorNames) 36 | } 37 | -------------------------------------------------------------------------------- /man/tripleEquation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{tripleEquation} 4 | \alias{tripleEquation} 5 | \title{Make equation with triple interaction} 6 | \usage{ 7 | tripleEquation( 8 | X = NULL, 9 | M = NULL, 10 | Y = NULL, 11 | labels = list(), 12 | vars = NULL, 13 | suffix = 0, 14 | moderator = list(), 15 | covar = NULL, 16 | range = TRUE, 17 | mode = 0, 18 | data = NULL, 19 | rangemode = 1, 20 | probs = c(0.16, 0.5, 0.84), 21 | effectsize = FALSE 22 | ) 23 | } 24 | \arguments{ 25 | \item{X}{Name of independent variable} 26 | 27 | \item{M}{Name of mediator} 28 | 29 | \item{Y}{Name of dependent variable} 30 | 31 | \item{labels}{A list of variables} 32 | 33 | \item{vars}{A list of variables names and sites} 34 | 35 | \item{suffix}{A number} 36 | 37 | \item{moderator}{A list of moderators} 38 | 39 | \item{covar}{A list of covariates} 40 | 41 | \item{range}{A logical} 42 | 43 | \item{mode}{A number} 44 | 45 | \item{data}{A data.frame} 46 | 47 | \item{rangemode}{range mode} 48 | 49 | \item{probs}{numeric vector of probabilities with values in [0,1]} 50 | 51 | \item{effectsize}{logical If true, calculate effectsize} 52 | } 53 | \description{ 54 | Make equation with triple interaction 55 | } 56 | \examples{ 57 | X="negemot";M="ideology";Y="govact";suffix=0 58 | cat(tripleEquation(X=X,M=M,Y=Y)) 59 | vars=list(name=list(c("sex","age")),site=list(c("a","c"))) 60 | vars=list(name=list(c("W","Z"),c("V","Q")),site=list(c("a","b","c"),c("a","b","c"))) 61 | X="negemot";Y="govact";suffix=0 62 | moderator=list(name=c("W"),site=list(c("b","c"))) 63 | cat(tripleEquation(X=X,Y=Y,moderator=moderator)) 64 | covar=list(name=c("C1","C2","C3"),site=list(c("M","Y"),c("Mi","Y"),"Y")) 65 | labels=list(X="negemot",M="ideology",Y="govact") 66 | cat(tripleEquation(labels=labels,moderator=moderator,covar=covar)) 67 | cat(tripleEquation(X=X,M=M,Y=Y,moderator=moderator,covar=covar,mode=1)) 68 | cat(tripleEquation(X=X,M=M,Y=Y,vars=vars)) 69 | cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,moderator=moderator,covar=covar)) 70 | cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,mode=1)) 71 | cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,covar=covar,mode=1)) 72 | X="negemot";Y="govact";suffix=0 73 | vars=list(name=list(c("sex","age")),site=list(c("c"))) 74 | cat(tripleEquation(X=X,Y=Y,vars=vars)) 75 | } 76 | -------------------------------------------------------------------------------- /man/tripleInteraction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tripleInteraction.R 3 | \name{tripleInteraction} 4 | \alias{tripleInteraction} 5 | \title{Make triple interaction equation} 6 | \usage{ 7 | tripleInteraction(vars, prefix = "c", suffix = 0, mode = 0, addPrefix = TRUE) 8 | } 9 | \arguments{ 10 | \item{vars}{variable names to be interact} 11 | 12 | \item{prefix}{A character} 13 | 14 | \item{suffix}{A number} 15 | 16 | \item{mode}{A number} 17 | 18 | \item{addPrefix}{A logical} 19 | } 20 | \description{ 21 | Make triple interaction equation 22 | } 23 | \examples{ 24 | vars=c("negemot","sex","age") 25 | tripleInteraction(vars) 26 | tripleInteraction(vars,mode=1) 27 | } 28 | -------------------------------------------------------------------------------- /man/unfold.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/condPlotCat2.R 3 | \name{unfold} 4 | \alias{unfold} 5 | \title{Unfold equations} 6 | \usage{ 7 | unfold(string, var = "W", mode = -1) 8 | } 9 | \arguments{ 10 | \item{string}{Character vectors with equation} 11 | 12 | \item{var}{name of variable} 13 | 14 | \item{mode}{integer. Default value is -1. If 0, get intercept, If 1, get slope} 15 | } 16 | \description{ 17 | Unfold equations 18 | } 19 | \examples{ 20 | string=c("(a1+b1*W)*(a2+b2*W)*(a3+b3*W)","a1+b1*W") 21 | unfold(string) 22 | } 23 | -------------------------------------------------------------------------------- /man/vars2df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drawConcept.R 3 | \name{vars2df} 4 | \alias{vars2df} 5 | \title{Make data.frame from a list of vars} 6 | \usage{ 7 | vars2df(vars, mpos = c(0.5, 0.9), df = NULL) 8 | } 9 | \arguments{ 10 | \item{vars}{A list} 11 | 12 | \item{mpos}{A numeric vector of length 2} 13 | 14 | \item{df}{A data.frame} 15 | } 16 | \description{ 17 | Make data.frame from a list of vars 18 | } 19 | \examples{ 20 | vars=list(name=list(c("tenure","age")),site=list(c("a","b"))) 21 | vars2df(vars) 22 | vars=list(name=list(c("milk","hair")),matrix=list(c(1,0,0,0,0,0,1,0,0,0)),pos=5) 23 | vars2df(vars) 24 | } 25 | -------------------------------------------------------------------------------- /man/vif.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/internal.R 3 | \name{vif} 4 | \alias{vif} 5 | \title{Variance Inflation Factors 6 | Calculates variance-inflation and generalized variance-inflation factors for linear, generalized linear, and other models.} 7 | \usage{ 8 | vif(mod) 9 | } 10 | \arguments{ 11 | \item{mod}{an object that responds to coef, vcov, and model.matrix, such as an lm or glm object.} 12 | } 13 | \value{ 14 | A vector of vifs, or a matrix containing one row for each term in the model, and columns for the GVIF, df. 15 | } 16 | \description{ 17 | Variance Inflation Factors 18 | Calculates variance-inflation and generalized variance-inflation factors for linear, generalized linear, and other models. 19 | } 20 | -------------------------------------------------------------------------------- /man/ztable.compareMC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/compareMC.R 3 | \name{ztable.compareMC} 4 | \alias{ztable.compareMC} 5 | \title{S3 method for class compareMC} 6 | \usage{ 7 | \method{ztable}{compareMC}(x, digits = digits, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class compareMC} 11 | 12 | \item{digits}{integer indicating the number of decimal places} 13 | 14 | \item{...}{further arguments to be passed to ztable} 15 | } 16 | \description{ 17 | S3 method for class compareMC 18 | } 19 | \examples{ 20 | \donttest{ 21 | require(ztable) 22 | fit=lm(govact~negemot*age,data=glbwarm) 23 | res=compareMC(fit) 24 | ztable(res) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /man/ztable.modelSummary.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ztable.modelSummary.R 3 | \name{ztable.modelSummary} 4 | \alias{ztable.modelSummary} 5 | \title{S3 method for class 'modelSummary'} 6 | \usage{ 7 | \method{ztable}{modelSummary}(x, digits = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{x}{An object of class modelSummary} 11 | 12 | \item{digits}{integer indicating the number of decimal places} 13 | 14 | \item{...}{Further argument to be passed to ztable} 15 | } 16 | \description{ 17 | S3 method for class 'modelSummary' 18 | } 19 | -------------------------------------------------------------------------------- /processR.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 4 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | -------------------------------------------------------------------------------- /vignettes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cardiomoon/processR/c6c817b5b716f2615b9814cd5022aef1cbc5c09d/vignettes/.DS_Store -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | --------------------------------------------------------------------------------