0

starter Q: How do I know if the data is filtered? Or how to filter a data?

Part1

part 2

Can someone please explain how to start the first part of my project. I've never used R before and had this project thrown at us. Thank you

KBeauty
  • 1
  • 1
  • 1
    A good start is searching for a "How make a scatter plot in R" tutorial. This is a good start. If you are stuck, ask questions here using a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Martin Gal Apr 28 '22 at 22:05
  • a) `plot(gdppc ~ fmtpop, data = yourdf)`; b) `library(dplyr); yourdf2 <-yourdf %>% mutate(lnfmtpop = log(fmtpop), lngdppc = log(gdppc))`; c) `plot(lngdppc ~ lnfmtpop, data = yourdf)`; c2) There is no need to create the log columns: `plot(gdppc ~ fmtpop, data = yourdf, log = "xy")` – Rui Barradas Apr 28 '22 at 22:06
  • 2
    Welcome to Stack Overflow. Can you contact your instructor or TA for resources? Was some knowledge of/experience with R a prerequisite for the course you're taking? People on SO are happy to help with homework questions, but we like you try to give us *something* to work with/show that you've tried to get started on your own (e.g. see @MartinGal's comment). – Ben Bolker Apr 28 '22 at 22:11
  • Thank you everyone. To answer Mr. Bolker's question, I'm taking an econ course. R was not a prereq, the professor just said that we should 'try' this project even though nobody in the class has any knowledge on R. – KBeauty Apr 28 '22 at 22:18
  • My question after looking at Barradas's comment is how do I go about filtering the data set? Would I need a code for that before jumping into part a? The question is: To do this problem set, you will need to create (generate) some new variables, which are functions of the variables in terrorism.da. You should restrict your analysis to the observations for which there are data on GDP per capita (i.e. for which gdppc is non-missing) and for which there are terrorist fatalities (i.e. for which fimpop > 0). [R Hint: Use filter( from dplyr package] – KBeauty Apr 28 '22 at 22:19
  • Do NOT use comments to add information that should have been in the question body. Instead use SO [edit] facilities. Also read up on how to ask homework questions. – IRTFM Apr 28 '22 at 23:32

0 Answers0