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.

narryabs
  • 3
  • 4
  • 2
    Welcome to StackOverflow! Please read and edit your question according to: [How to make a great R reproducible example](https://stackoverflow.com/questions/5963269/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 '18 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 '18 at 23:29
  • 2
    Are you sure you are allowed to ask for external help on an **exam** question? – Axeman Dec 13 '18 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 '18 at 23:31

1 Answers1

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!

morgan121
  • 2,213
  • 1
  • 15
  • 33