0

I'm new to R and for an exam he is asking way over our heads on a question for a newbie. Any point in right direction would be greatly appreciated.

Using the Default dataset, we are supposed to create a 95% confidence interval using the difference in median balance to income ratio by student status.

Not sure how to find the income ratio by student status. Assuming I am supposed to be doing something with bootstrapping by the end of the question.

4
  • 2
    Welcome to StackOverflow! Please read and edit your question according to: How to make a great R reproducible example so that we could help you. Without input data and wanted output it's impossible to answer (and understand) your question.
    – pogibas
    Dec 13, 2018 at 23:25
  • Yeah, that's the thing... the exact question given is "Using the Default dataset, create a 95% confidence interval for the difference in median balance to income ratio by student status."
    – narryabs
    Dec 13, 2018 at 23:29
  • 2
    Are you sure you are allowed to ask for external help on an exam question?
    – Axeman
    Dec 13, 2018 at 23:29
  • I don't want the actual answer, we are allowed to google and look for external help. I just want a point in the right direction to what I should be looking at to help me begin.
    – narryabs
    Dec 13, 2018 at 23:31

1 Answer 1

1

Base off nothing here is how I interperet this question:

The ratio will be between the columns 'balance' and 'income'. Here is how to obtain that value:

 dds$ratio <- dds$balance/dds$income #where dds is your default data set and you may need to replace 'balance and 'income' with whatever is in your dataset

Now you will need to group by the status. One way to do this is to use dplyr like this:

 dds %>%
   group_by(status) %>%    # replace status with whatever your column is named
   summarise(Median=median(ratio))

Now you will need to use whichever statistical test you feel appropriate and calculate the associated 95% confidence interval.

Hope this helps!

2
  • 1
    Thank you, I greatly appreciate it. I was going insane trying to figure out how to start this lol
    – narryabs
    Dec 13, 2018 at 23:55
  • No worries :) hope the rest of your exam goes well!
    – morgan121
    Dec 13, 2018 at 23:56

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.