Learn R Programming

PathSelectMP (version 1.1)

TotalRiskRatios: Calculate Risk Ratios for total effects

Description

Risk Ratios for the total effects are calculated using threshold values obtained for direct effects and the total effect values see in AllTotalEffOutput

Usage

TotalRiskRatios(AllDat, Directry = getwd(), InputDepVal = 1)

Arguments

AllDat

output from ConvertData2

Directry

this the path where the folder specified by AllNames is located and default is working directory

InputDepVal

a number which is the value of the dependent variable used for risk ratio which is compared to 0 in risk ratio calculation, default value is 1

Value

returns data frame with risk ratios in place of total effects

Details

total effects are sum of direct and indirect effects where indirect effects are the product of all direct effects in the chain which comprises the indirect variable chain, this total effect value is converted to its probability using the threshold values for direct effects and multiplying the total effect with the specified input value

References

M Plus

See Also

codeAllTotalEffOutput, codeAverageRRs

Examples

Run this code
# NOT RUN {
InitD=Simulate(MissingYN=1)
xxx=Initialize(InitD,NumImpute=3,WhichCat=c(1,1,1,1,0))
ggg=AllBackwardSelect(xxx[[1]])
yyy=AllSummary2(xxx[[1]])
AllDat1=ConvertData2(xxx[[1]],xxx[[2]],yyy[[1]])
RRT1=lapply(AllDat1,TotalRiskRatios,InputDepVal=1)
# }

Run the code above in your browser using DataLab