If you type:
class(z.ex)
you'll see that your z-test produces an object with a class "htest."
Then type:
methods("plot")
you'll get a list of all the types of objects that the plot() function
knows how to make plots for. It doesn't look like plot has a sub-
method for an htest object, so it probably doesn't know how to handle
the type of data you are putting into it.
Andrew Miles
Department of Sociology
Duke University
On Sep 27, 2010, at 11:03 PM, Kie Kyon Huang wrote:
Hi, I am a beginner in R and is trying to plot some dot plot from t
test
result.
I was following the example
## Example from z.test -- requires TeachingDemos package
# library(TeachingDemos)
# z.ex <- z.test(rnorm(25,100,5),99,5)
# z.ex
# plot(z.ex)
but encounter this error for the last command
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
the z.ex looks fine though
One Sample z-test
data: rnorm(25, 100, 5)
z = 0.7622, n = 25, Std. Dev. = 5, Std. Dev. of the sample mean = 1,
p-value = 0.4459
alternative hypothesis: true mean is not equal to 99
95 percent confidence interval:
97.80223 101.72216
sample estimates:
mean of rnorm(25, 100, 5)
99.7622
Can someone help me out here?
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.