My graphs are not showing up correctly

Hello,
I'm not sure what I did wrong, but my graphs are not showing up correctly once I run the code. Please help me figure out what's the problem is.

This is my code and graphs
x = rnorm(1000,4,1);x

xbar = {}
for (i in 1:100)
{
x = sample(x,50);
xbar[i] = mean(x);
}
print(xbar)

par(mfrow = c(2,2))
plot(xbar)
hist(xbar)
qqnorm(xbar)
qqline(xbar)

This is what the graphs are supposed to look like

Hi,
There is nothing wrong with your graphs, they do exactly what they should do.
But you should have a look at xbar before plotting it. The problem lies within the method you are using to produce your data.

Thank you so much! I found out what I did wrong with the xbar

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.