我需要帮助将这两个图组合成R中的一个

时间:2015-03-10 13:28:38

标签: r regression

任何人都可以帮我合并这两个显示性别0和男性1的图表

## When Gender = 0

int<- -3.4839
FC<- -0.5278
FCV<-seq(1,4,by=.5)
EY<-plogis(int+FC*FCV)

plot(EY~FCV,type="o",col.lab="black", cex.lab=1,col.axis="black",col="purple",xlab="Family Cohesion When Gender is ", ylab="Expected Probability of Binge Drinking", mar=c(7,7))


## When Gender = 1


int<- -3.4839+ -0.6433 
FC<- -0.5278
FCV<-seq(1,4,by=.5)
EY<-plogis(int+FC*FCV)

plot(EY~FCV,type="o",col.lab="black", cex.lab=1,col.axis="black",col="blue",xlab="Family Cohesion", ylab="Expected Probability of Binge Drinking", mar=c(7,7))

1 个答案:

答案 0 :(得分:0)

这是你想要的吗?

int<- -3.4839
FC<- -0.5278
FCV<-seq(1,4,by=.5)
EY<-plogis(int+FC*FCV)

plot(EY~FCV,type="o",col.lab="black", cex.lab=1,col.axis="black",col="purple",
xlab="Family Cohesion When Gender is ", ylab="Expected Probability of Binge Drinking", 
mar=c(7,7),ylim=c(0,0.02))

int<- -3.4839+ -0.6433 
FC<- -0.5278
FCV<-seq(1,4,by=.5)
EY<-plogis(int+FC*FCV)

lines(EY~FCV,type="o",col.lab="black", cex.lab=1,col.axis="black", col="blue",
xlab="Family Cohesion", ylab="Expected Probability of Binge Drinking", mar=c(7,7))

我只是在第一次plot来电中添加了xlim = c(0,0.02),并在第二次通话中将plot替换为lines