0

I have a database named AllDataset that contains the following data: sex- (male, female) smoke- (yes, no) age- continuous variable target- binary(0,1) I check the relationship between smoking gender and age to the explained target variable using logistic regression. I performed the analysis and right now I need to find a representative graph. I tried to use a scatter graph, but the values do not scatter from the box where the target variable is (suffered from a heart attack/does not suffer from a heart attack) I would appreciate it if you could help me find a suitable graph

I tried to make a scatter graph but the data does not scatter for the reason that the target variable allows this, I am looking for a graph that will represent the relationship between the explanatory variables and the explained variable - the target

  • 1
    Consider an "interaction plot". The y-axis is the predicted probability of your target variable, the x-axis is age, you facet the graph by sex and then have two lines on each facet, one for smokers and one for non-smokers. If you provide a good enough sample of your dataset or a toy dataset we can demonstrate using R. – George Savva Jun 05 '23 at 08:56
  • Hi, thank you very much for the reply, I will add my dataset I wanted to check the relationship between heart attacks and smoking gender and age here.https://drive.google.com/file/d/1BSpcYg15BlomQT9WJCVOHhWr13kvdG82/view?usp=sharing – Tair Ishay Jun 05 '23 at 12:17
  • 1
    Can you add your dataset (or a sample of it) to the question text using (eg using `dput`). See the top answer here on how to make a good minimal dataset for a question: https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – George Savva Jun 05 '23 at 13:14
  • 1
    Asking for advice on data visualization is on topic at [stats.se], not Stack Overflow. If you have a specific programming question, it's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. If you don't even know what output you want, get some plotting advice first. – MrFlick Jun 05 '23 at 14:15

0 Answers0