r/rprogramming • u/GrouchyStay6575 • Oct 18 '21
r studio :( PLEASE HELP
hi! i have a homework where i have to select random samples from random groups with r.and i dont know what to do i've spent my whole weekend trying to figure out r but it is soo hard and complicated.Can you help me please?
3
Oct 18 '21
To second the previous poster and expand slightly - as you may have figured out, all problems in R are very specific. We can give you advice if you post the code you have and the error(s) you are getting but just saying you are trying to use r.and isn't enough!
-1
u/GrouchyStay6575 Oct 18 '21
i couldn't write any codes because i dont know anything about it(except the sample() code).i have a problem and i should solve it using r.please help if you have any idea.problem:
A service agency wishes to assess its clients’ views on quality of service over the past year. Computer records identify 1000 clients over the past 12 months, and a decision is made to select 100 clients to survey.
(a) Describe a procedure for selecting a simple random sample of 100 clients from last year’s population of 1000 clients.
(b) The population of 1000 clients consists of 80 CaucasianAmericans, 150 African-Americans and 50 Hispanic-Americans. Describe an alternative procedure for selecting a representative random sample of size 100 from the population of 1000 clients
2
u/niffreallynaff Oct 18 '21
You said you have sample code. Provide that code and it will be easier for people to help you.
-5
u/GrouchyStay6575 Oct 18 '21
i said i only know the code sample(). i dont have a sample code.i recommend you read carefully before you make comments on social media.
6
4
u/niffreallynaff Oct 18 '21
OK np, I won't bother then, you can read the same things I googled to help you with this. Sorry for commenting, but I did make sure I read and understood all the words in your reply several times before I wrote this comment, so hopefully it is up to your standard.
3
u/reedinrainbow Oct 18 '21
From your problem you don't need R or even how to use it. Ask Google how to sample from a group using R. You should be able to find two ways and it seems like that is all the question is asking of you.
1
Oct 18 '21
Finally, people not shouting "LEARN BY DOING" at this dude, but 2) equally disappointed with the lack of effort by OP. Net gain = 0
1
u/orgoca Oct 18 '21
It seems that what you need to do in P2 is stratified sampling. Here is an article that can walk you through it: https://link.medium.com/XL7yYbBHskb
4
u/reedinrainbow Oct 18 '21
How far did you get?