[R] Help sourcing datasets (.csv)
tebert @end|ng |rom u||@edu
Fri Jun 2 17:55:08 CEST 2023
The statistics does not care where the numbers come from. The values 1, 2, 3 have a mean of 2 no matter if these are weights of a bird, plant heights, or concrete tensile strength. Your interpretation might change, but the mean is still 2.
Try synthetic data.
X<-rnorm(1000, mean=4, sd=2)
That is too simple, but it is the start.
Y<- rnorm(1000, mean=14, sd=2) + 12*X
look at the result in something like ggplot2
Dataf <- data.frame(X,Y)
ggplot(Dataf, aes(X, Y)) + geom.point() + stat_smooth(method=lm, se=FALSE)
This approach has a few advantages:
1) I know that X and Y are samples from the Gaussian (Normal) distribution.
2) I know that the data are homoscedastic.
3) I can change 1 and 2 in whatever way I want. Possibly useful if you want to understand how violations in model assumptions influence outcomes.
4) I can look closely at the influence of sample size when assumptions are met and when they are not.
Note that ANOVA and regression do not assume that the independent or dependent variables are normally distributed. The assumption of Normality is for the error term in the model. However, if both dependent and independent variables are normally distributed then it is likely that the error term will also be normally distributed.
What should I get here?
Y<- rnorm(1000, mean=14, sd=2) + X*rnorm(1000, mean=12, sd=27)
From: R-help <r-help-bounces using r-project.org> On Behalf Of Uwe Ligges
Sent: Friday, June 2, 2023 5:18 AM
To: james carrigan <james5431 using hotmail.com>; r-help using r-project.org
Subject: Re: [R] Help sourcing datasets (.csv)
On 28.05.2023 10:53, james carrigan wrote:
> Dear Sir or Madam
> I'm trying to compile a collection of datasets that require use of the following hypothesis tests.
> Are there datasets within the R library that I can get access to?
> Kind regards
> James Carrigan
> Hypothesis Testing
> - performs a two sample t-test between X and Y
> - performs a paired t-test between X and Y prop.test(x = c(a, b), n =
> c(n1, n2)) - performs a 2-sample test for equality of proportions with
> continuity correction
> Sent from my iPad Sent from my iPhone
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.r-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help