R studio model code


#1

hello R experts

im a new stat professor in NC state and would like to include three basic models with my readmission healthcare data for class

there are alot of syntax examples there and would like to use the following

Trees
Log Reg
Neural Net

I think the packages I need are
Rpart
Rpat.plot
GLM
Nnet

would it be possible to guide me to that syntax to apply to my data for class pls?
thanks!

ghabek@ncsu.edu


#2

Hey George. You're going to struggle a bit getting help with a question this broad. To be honest I'm not even sure what you're really asking, which makes it hard to give you help. You mention "readmission healthcare data" which sounds interesting. Is this public data you can share?

Then you mention three things you would like to use: Trees, Log Reg, Neural Net. For a tree based model, like CART the rpart package does make sense. You seem to know that. So what's your question? Have you tried it? Did you get an error?

For 'log reg' I am assuming you mean Logistic Regression. That comes built into R via the Core R package stats and can be built using the glm function. Datacamp has done an pretty good intro to Logistic Regression that you may find useful: https://www.datacamp.com/community/tutorials/logistic-regression-R If you have some specific questions, please ask.

For Neural Networks there are multiple packages that might help. What have you tried? What didn't work? Here's an article that might be interesting: https://www.kdnuggets.com/2016/08/begineers-guide-neural-networks-r.html

After you do your homework and have some specific questions, come back and I'm bet we can give you more support.


#3

Second @jdlong's comment and just want to add, that if you are looking for running and comparing multiple models, I highly recommend the mlr package


#4

This appears to be approximately the same as a post you made here earlier:

Please see our FAQ about cross-posting/re-posting: