任何人都可以帮我合并这两个显示性别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))
答案 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
。