I have this question I hope you can answer. First, lets see this simple example, using the Student's t-test:> test<-t.test(miTest.data, mu=0.5, conf.level=0.90 ) > testOne Sample t-test data: miTest.data t = 0.5222, df = 9, p-value = 0.6141 alternative hypothesis: true mean is not equal to 5 90 percent confidence interval: 3.744928 7.255072 sample estimates: mean of x 5.5 The question is: what kind of expression should I use to get the confidence interval? That is, what expression should <exp> be, so> confInterval <- <exp> > cinfInterval[1] 3.744928 7.255072>Thanks in advance, Guillermo. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
gbrajovic at entelchile.net writes:> The question is: what kind of expression should I use to get the confidence interval? That is, what expression should <exp> be, so > > > confInterval <- <exp> > > cinfInterval > [1] 3.744928 7.255072 > > >test$conf.int For a more generalizable solution consider the output of names(test) str(test) unclass(test) -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Good evening! On 22-Nov-00 gbrajovic at entelchile.net wrote:> > I have this question I hope you can answer. First, lets see this simple > example, using the Student's t-test: > > >> test<-t.test(miTest.data, mu=0.5, conf.level=0.90 ) >> test > > One Sample t-test > > data: miTest.data > t = 0.5222, df = 9, p-value = 0.6141 > alternative hypothesis: true mean is not equal to 5 > 90 percent confidence interval: > 3.744928 7.255072 > sample estimates: > mean of x > 5.5 > > The question is: what kind of expression should I use to get the confidence > interval? That is, what expression should <exp> be, so > >> confInterval <- <exp> >> cinfInterval > [1] 3.744928 7.255072Try confInterval <- t.test(miTest.data, mu=0.5, conf.level=0.90)$conf.int[1:2] Details are found in help(t.test) Happy R´ing! Detlef ---- Detlef Steuer ** Universität der Bw ** 22043 Hamburg steuer at unibw-hamburg.de Th. Adorno: "Die Neigung zum Okkultismus ist ein Symptom der Rückbildung des Bewusstseins." -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
gbrajovic at entelchile.net wrote:> > I have this question I hope you can answer. First, lets see this simple example, using the Student's t-test: > > > test<-t.test(miTest.data, mu=0.5, conf.level=0.90 ) > > test > > One Sample t-test > > data: miTest.data > t = 0.5222, df = 9, p-value = 0.6141 > alternative hypothesis: true mean is not equal to 5 > 90 percent confidence interval: > 3.744928 7.255072 > sample estimates: > mean of x > 5.5 > > The question is: what kind of expression should I use to get the confidence interval? That is, what expression should <exp> be, so > > > confInterval <- <exp> > > cinfInterval > [1] 3.744928 7.255072Example: my.t.test <- t.test(rnorm(100)) str(my.t.test) # So you see, that <exp> can be replaced with: my.t.test$conf.int[1:2] Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._