[R] extracting pvalues from ttest

1Rnwb sbpurohit at gmail.com
Tue Sep 8 18:42:51 CEST 2009


okay fixed it by putting "c" in quote marks. 


1Rnwb wrote:
> 
> Hello, I am using "B" as a vector to store all the t.tests. since i am a
> newbie to both R and statistics I am not sure if "B" is the list. Also I
> see "c" used in the do.call formula and do not know what it is being used
> for. I used aggregate but getting this error" Error in
> aggregate.data.frame(eo, eo$PlateID, function(.sub) t.test(ENA78 ~  :  
> 'by' must be a list". 
> As i mention in my OP that I am using is function from an earlier post.
> any help is appreciated.
> Thanks
> Sharad
> 
> 
> Jun Shen-3 wrote:
>> 
>> I never used "by". Is "B" a list? If not, I am not sure if lapply can
>> take
>> it. Try aggregate().
>> 
>> On Fri, Aug 28, 2009 at 10:53 AM, 1Rnwb <sbpurohit at gmail.com> wrote:
>> 
>>>
>>> Hello list,
>>>
>>> I have a similar issue as this post
>>> http://tolstoy.newcastle.edu.au/R/e6/help/09/04/11438.html#options2 and
>>> I
>>> used the suggestion provided by Jorge with modifications to my data
>>> do.call(c,lapply(your_list_with_the_t_tests,function(x) x$p.value))
>>>
>>> but I am getting the following error after excuting the code
>>>
>>> B<-by(eo,eo$PlateID, function(.sub) t.test(mcp1~Self_T1D,data=.sub,
>>> na.rm=T)) #ttest platewise
>>> do.call(c,lapply(B, function(x) x$p.value))
>>> Error in do.call(c, lapply(B, function(x) x$p.value)) :
>>>  'what' must be a character string or a function
>>>
>>> here "B" is equal to "your_list_with_the_t_tests. is something i am
>>> doing
>>> wrong
>>> >
>>> --
>>> View this message in context:
>>> http://www.nabble.com/extracting-pvalues-from-ttest-tp25192381p25192381.html
>>> Sent from the R help mailing list archive at Nabble.com.
>>>
>>> ______________________________________________
>>> R-help at 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.
>>>
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> ______________________________________________
>> R-help at 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.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/extracting-pvalues-from-ttest-tp25192381p25349826.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list