0

I've got a large dataset with multiple, asynchronous measurements of labvalues, and I can't figure out how to to visualize these through individual lines, scatter plots, and a scatter plot with logistic regression lines.

Also, I want to lable patiens from categories, so i cant simply create new columns of lab_moment1 - lab_moment3 for the X and values1 - 3 for the Y.

So I want to visualize all the xy coordinates of the labmoments and values in one scatter plot, whilst preserving the patient categories.


Dataset:

ID Mutation    Lab_moment1  Lab_moment2   Lab_moment3   Lab_value1    Lab_value2     Lab_value3 
1   1           4            6             11            0.9           0.1             0.7    
2   2           2            3             12            1.9           0.2             0.15     
3   1           10           15            19            0.13          0.4             0.25   
4   3           9            11            20            0.7           0.83            0.5    
5   3           1            6             11            1.1           0.2             2.3   
1

1 Answer 1

0

Solved it myself by converting the dataset to Long format. You can then simply input a single x and y, R will recognize the ID's itself and plot it using the geom_point() and geom_smooth()

Sign up to request clarification or add additional context in comments.

1 Comment

well done finding the solution. I marked your question as a duplicate, but that does not mean that you need to delete it. Keep it, so search engines may be more likely to find a good thread for their similar question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.