writing function for logistic regression
1
0
Entering edit mode
6.3 years ago

Hi, My .csv files contain 2021 rows with 25 columns. All of the columns have "0" or "1" on the basis of absence and presence. I want to see the correlation among column CAS_COUNT(24), ACR_COUNT(25) and Antibiotic(8-23). Logistic regression analysis might be the best way to describe the association. I am very new to R programming and almost zero coding background. Any help to write a code for this purpose?

[1] "ASSEMBLY"               "ORGANISM"               "ANTI_I_E"               "ANTI_I_F"              
[5] "ACA1"                   "I.E"                    "I.F"                    "Aminoglycoside"        
[9] "Beta_lactam"            "colistin"               "fosfomycin"             "fusidicacid"           
[13] "glycopeptid"            "macrolide"              "nitroimidazole"         "oxazolidinone"         
[17] "oxazolidinone_phenicol" "phenicol"               "quinolone"              "rifampicin"            
[21] "sulphonamide"           "tetracycline"           "trimethoprim"           "CAS_COUNT"             
[25] "ACR_COUNT"

Example of the first line:

   GCA_000148745.1 Pseudomonas aeruginosa 39016 chromosome whole genome shotgun 0 0 0 0 0 0 0 0 0 0......
statistic R • 1.3k views
ADD COMMENT
0
Entering edit mode

I am very new to R programming and almost zero coding background. Any help to write a code for this purpose?

Maybe this project isn't the most optimal to be your first R coding project. You could do yourself a favour and spend a few hours/days following R tutorials - your understanding will increase a lot and it will definitely pay off in the long run.

ADD REPLY
0
Entering edit mode

I want to see the correlation...

Then compute correlation coefficients.
What is the question you're trying to answer ?
If you take a regression approach, what is the dependent variable ?

ADD REPLY
3
Entering edit mode
6.3 years ago
Michael 55k

There is a tutorial here, https://www.r-bloggers.com/how-to-perform-a-logistic-regression-in-r/ Working through the example "Titanic" dataset might give you an impression on whether your assumption on the method is ok. There are many questions that could be asked about the variables in your data. Unfortunately, I do not understand your data and approach well-enough to tell whether they are sane.

ADD COMMENT

Login before adding your answer.

Traffic: 1817 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6