d*******1 发帖数: 854 | 1 我以前问的那个问题,你建议用如下的function把p value 拿出来,
res<- sapply(result, function(x)
{fs<- summary(x)$fstatistic;pf(fs[1],fs[2],fs[3],lower
.tail=F)}
)
但是我现在还想把least square mean of difference between treatment and
control拿出来, 但是不知道用什么命令。我试图用str(result)弄清result的结构,
但是没有看到fstatistic这个component.....
请指教。 | s*r 发帖数: 2757 | | D******n 发帖数: 2836 | 3 names(summary(x))
lower
,
【在 d*******1 的大作中提到】 : 我以前问的那个问题,你建议用如下的function把p value 拿出来, : res<- sapply(result, function(x) : {fs<- summary(x)$fstatistic;pf(fs[1],fs[2],fs[3],lower : .tail=F)} : ) : 但是我现在还想把least square mean of difference between treatment and : control拿出来, 但是不知道用什么命令。我试图用str(result)弄清result的结构, : 但是没有看到fstatistic这个component..... : 请指教。
| d*******1 发帖数: 854 | 4 50怎么样? 还有一笔帐要还, 所以囊中羞涩了, 呵呵
【在 s*r 的大作中提到】 : 100wb
| D******n 发帖数: 2836 | 5 SIR must earn a lot.....
【在 s*r 的大作中提到】 : 100wb
| s*r 发帖数: 2757 | 6 ok, given my negative answer
the idea of least square mean is probably SAS's invention. the R community
probably dislikes the concept. for example:
http://tolstoy.newcastle.edu.au/R/help/05/09/12613.html
【在 d*******1 的大作中提到】 : 50怎么样? 还有一笔帐要还, 所以囊中羞涩了, 呵呵
| s*r 发帖数: 2757 | 7 i spent a lot
【在 D******n 的大作中提到】 : SIR must earn a lot.....
| d*******1 发帖数: 854 | 8 > names(summary(result))
NULL
> names(summary(res))
[1] "Min." "1st Qu." "Median" "Mean" "3rd Qu." "Max."
还是没有看到类似于fstatistic, coefficient和estimate之类的重要东东啊?
【在 D******n 的大作中提到】 : names(summary(x)) : : lower : ,
| d*******1 发帖数: 854 | 9 I cannot care less about least square mean. however, what i do care is how
to parse out the important statistics (like parameter estimation, standard
deviation of parameter, variance-covariance matrix etc.) from the result of
lm(). howeve, it seem really difficult for me to get hold of the structure
of object that storing statistics. even str() and names() do not help a
whole lot here.
can you provide any insight?
thanks
【在 s*r 的大作中提到】 : ok, given my negative answer : the idea of least square mean is probably SAS's invention. the R community : probably dislikes the concept. for example: : http://tolstoy.newcastle.edu.au/R/help/05/09/12613.html
| s*r 发帖数: 2757 | 10 names should be helpful.
of
【在 d*******1 的大作中提到】 : I cannot care less about least square mean. however, what i do care is how : to parse out the important statistics (like parameter estimation, standard : deviation of parameter, variance-covariance matrix etc.) from the result of : lm(). howeve, it seem really difficult for me to get hold of the structure : of object that storing statistics. even str() and names() do not help a : whole lot here. : can you provide any insight? : thanks
| | | s*r 发帖数: 2757 | 11 if 'res' is a vector, you will get
if 'res' is other types of object, the output of names(summary()) will be
different.
the following section is from the help for function lm
"Value
lm returns an object of class "lm" or for multiple responses of class c("mlm
", "lm").
The functions summary and anova are used to obtain and print a summary and
analysis of variance table of the results. The generic accessor functions
coefficients, effects, fitted.values and residuals extract various useful
features | d*******1 发帖数: 854 | 12 ok, here is what i am doing:
result<- lapply(split(all,all$CHIPEXP_NAME),function(x) lm(logvalue~
treatment,x))
用lapply拿到result(是个 vector)
再用:
res<- sapply(result, function(x)
{fs<- summary(x)$fstatistic;pf(fs[1],fs[2],fs[3],lower
.tail=F)}
)
拿到每个by variable 的 p value, 我的问题是怎样拿到其他stat呢?比如parameter
estimtate, parameter stderr, degree of freedom.....etc? 如何看到result 的结
构呢?
用names(result)只是得到所有by variable的值, 因为我这个result是由lapply产生
的一个vector, 每个by varaible的值都成了colum
【在 s*r 的大作中提到】 : names should be helpful. : : of
| D******n 发帖数: 2836 | 13 names(result[[1]])
names(summary(result[[1]]))
lower
parameter
【在 d*******1 的大作中提到】 : ok, here is what i am doing: : result<- lapply(split(all,all$CHIPEXP_NAME),function(x) lm(logvalue~ : treatment,x)) : 用lapply拿到result(是个 vector) : 再用: : res<- sapply(result, function(x) : {fs<- summary(x)$fstatistic;pf(fs[1],fs[2],fs[3],lower : .tail=F)} : ) : 拿到每个by variable 的 p value, 我的问题是怎样拿到其他stat呢?比如parameter
| D******n 发帖数: 2836 | 14 result is a list,
result[[i]] is its ith element , which is a lm type data structure and basic
ally a list.
lower
parameter
【在 d*******1 的大作中提到】 : ok, here is what i am doing: : result<- lapply(split(all,all$CHIPEXP_NAME),function(x) lm(logvalue~ : treatment,x)) : 用lapply拿到result(是个 vector) : 再用: : res<- sapply(result, function(x) : {fs<- summary(x)$fstatistic;pf(fs[1],fs[2],fs[3],lower : .tail=F)} : ) : 拿到每个by variable 的 p value, 我的问题是怎样拿到其他stat呢?比如parameter
| d*******1 发帖数: 854 | 15 太感谢了, 大大有帮助, 那 result[1]又是什么呢
basic
【在 D******n 的大作中提到】 : result is a list, : result[[i]] is its ith element , which is a lm type data structure and basic : ally a list. : : lower : parameter
|
|