p******s 发帖数: 229 | 1 现有一组病人,其中一部份发生上消化道出血,一部份发生腹泻,有的2种症状都出现
了。老板要我用chisq test去看性别在出血的病人,腹泻的病人,和所有的病人中分布
是否一样;用anova 去看年龄在出血病人,腹泻病人,和所有病人中分布是否一样。
他并不是要比较出血病人和非出血病人,腹泻和非腹泻病人。他非要出血的,腹泻的,
和所有的比出一个p value。我是觉得这3个样本不是独立样本,不是mutually
exclusive,其中2个是另1个的子集,而且那2个还有overlap,没法用chisq 和 anova
去做。跟他解释了,他是医生,要坚持他的做法。
大家觉得该怎么做呢?有其他统计方法去比较这样的3个样本吗?
谢谢! |
|
o******6 发帖数: 538 | 2 ☆─────────────────────────────────────☆
hjdut (hehe) 于 (Thu Feb 7 12:27:15 2008) 提到:
for example, an expression such as chisq(df=1,ncp=0) ?
thanks
☆─────────────────────────────────────☆
statcompute (statcompute) 于 (Thu Feb 7 12:42:20 2008) 提到:
?dchisq()
☆─────────────────────────────────────☆
hjdut (hehe) 于 (Thu Feb 7 12:47:00 2008) 提到:
o, I finally found out that I forgot to include dchisq(1,df=?,ncp=?), I
forgot the argument 1 here, thanks |
|
jl 发帖数: 398 | 3 R 里面的 Anderson-Darling , CVM 缺省是用来 test normality的.
什么R Pakcage支持 test Expentional, Chisq,... distribution.
多谢! |
|
n*****n 发帖数: 3123 | 4 你resp是表示response吗?
可以把x2看做confonder (如果没有顺序关系在里面), 这样就是三个2*2 table
proc freq;
weight count;
table x2*y*x1 /chisq cmh;
run; |
|
P**********c 发帖数: 17 | 5 这一个才是啦。
PROC FREQ DATA=TEST;
WEIGHT COUNT;
TABLE x1*x2*y / CHISQ;
RUN; |
|
b*****e 发帖数: 5 | 6 goodness of fit 里 Chisq stat 是 (O_i-E_i)^2/E_i 再所有i加合,可是有的时候也
写成(y_i-mu_i)^2/var(y_i)加合,例如Y_i是binomial(n_i, pi_i), 加合的每项就是(
y_i-n_i*pi_i)^2/(n_i*pi_i*(1-pi_i))。可是按道理这两个是同样的东东呀,为什么
后面写法的分母不是EY_i 呢?
菜鸟想也想不明白,请哪位能指点一下,多谢! |
|
y*****w 发帖数: 1350 | 7 It seems survreg() in R and PROC LIFEREG in SAS run the same type of
survival analysis. However, when I ran both of them on a survival data, I
got different results. Both were set as exponential distribution, and have
right censored data. See below. Could anybody tell me why the results are
different? Did I miss specifying any important parameters in R? Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The R code:
survFit <- survreg(Surv(time, event, type="right") ~... 阅读全帖 |
|
t**k 发帖数: 139 | 8 If you have and use R, do this to run chisq test:
a=matrix(c(8,8,13,3), 2)
chisq.test(a)
and get:
Pearson's Chi-squared test with Yates' continuity correction
data: a
X-squared = 2.2165, df = 1, p-value = 0.1365
However as a rule of thumb, if any cell counts in the 2x2 table is less than
5 you should use Fisher's exact test, which gives:
> fisher.test(a)
Fisher's Exact Test for Count Data
data: a
p-value = 0.1351
alternative hypothesis: true odds ratio is not equal to 1
95 percent conf... 阅读全帖 |
|
q********i 发帖数: 795 | 9 F is the ratio of two chisq/df, t is z over sqrt of chisq/df, z^2 is chisq 1
. that is why f(1,df2)=t(df2)^2 |
|
s*********e 发帖数: 1051 | 10 below was posted on my blog before and hope it helpful.
/************************************************
* ARMA - GARCH ESTIMATION USING PROC MODEL *
************************************************/
data garch;
lu = 0;
lh = 0;
ly = 0;
do i = 1 to 1000;
h = 0.3 + 0.4 * lu ** 2 + 0.5 * lh;
u = sqrt(h) * rannor(1);
y = 1 + 0.6 * (ly - 1) + u - 0.7 * lu;
lu = u;
lh = h;
ly = y;
output;
end;
run;
proc model data = garch;
parms ar1 ma1 mu;
y = mu + ar1 ... 阅读全帖 |
|
z******n 发帖数: 397 | 11 我想我的看法不大受重视。所以构造了一个数值例子。为了使得结果能够重复,我固定
了随机数种子
set.seed(2)
library("mvtnorm")
n<-100
rho<-.9
bet<-c(.1,.1)
sigma<-matrix(c(1, rho, rho, 1), ncol=2)
x<-rmvnorm(n, sigma=sigma)
e<-rnorm(n,sd=.8)
y<-x%*%bet+e
data<-data.frame(y, x)
colnames(data)<-c("y", "x1", "x2")
mdl0<-lm(y~1, data=data)
mdl1<-lm(y~x1,data=data)
mdl2<-lm(y~x2,data=data)
mdl<-lm(y~x1+x2, data=data)
> anova(mdl0, mdl1, test="Chisq")[2, "Pr(>Chi)"]
[1] 0.03725746
> anova(mdl0, mdl2, test="Chisq")[2, "Pr(>Chi)"]
[1] 0.03311402
> anov... 阅读全帖 |
|
g******n 发帖数: 339 | 12 In clinical trials, people also use Fisher's exact test to compare two
proportions when the sample sizes are not large(<1000). The results may not
differ much from the chisq test though.
Use SAS PROC FREQ for fisher and chisq. |
|
s*******f 发帖数: 148 | 13 要做几十个simple logistic regression,然后将每个模型中Wald Test得到的Wald
Chi-square, p-value, OR, CI提出来,列成表格。不太高兴对着每个output找对应的
值再填到表格里去,想偷懒让SAS自己汇报,不知道是否可行?
知道在PROC FREQ下面可以通过 OUTPUT OUT = NewSet chisq; 保存分析结果,这样后
面就可以提取p-value等等。不过PROC LOGISTIC里面找了半天,好像没有对应chisq的
option可以把p值什么都保存下来。是不是我的思路不对头?虚心求教:) |
|
l*******d 发帖数: 101 | 14 这样啊。那还不如直接把结果存成如下格式:
Var1 Var2 chisq p
A B ??? ???
A C ??? ???
A D ??? ???
B C ??? ???
B D ??? ???
把这个矩阵叫X. 然后你可以直接查找:
which (X[,4]<0.05)
However, as you're probably already aware, 0.05 wouldn't be suitable here
since you're doing multiple tests.
You need to adjust the p value threshold.
另外,你还可以把Var1, Var2的数据也做成这个格式,这样你算chisq时就是对数列而
不是矩阵操作了。 |
|
g**********l 发帖数: 214 | 15 请教, 如果 chisq test said it is not independent, that "kinda" proves
catalog has an effect. 但是要这个结论的话,直接 用 t-test 去比较两个
conversion rate 不是更快吗?
我不太明白这个 contingency table 做 chisq test 有什么有处。
谢谢 |
|
h***b 发帖数: 43 | 16 我没系统学习过GLM,就是在网上自学了一下,有个问题想请教一下,问什么下面的结
果里面每个categorical variable最后一组的Wald Chi-Square 和 Pr > ChiSq 都是 .
? 谢谢!
Analysis Of Maximum Likelihood Parameter Estimates
Parameter DF Estimate Standard Error Wald 95%
Confidence Limits Wald Chi-Square Pr > ChiSq
Intercept 1 -1.3168 0.0903 -1.4937 -1.1398 212
.73 <.0001
car large 1 -1.7643 0.2724 -2.2981 -1.2304 41.96
<.0001
car medium 1 -0.6928 ... 阅读全帖 |
|
a*******g 发帖数: 80 | 17 目的:比较两种不同手术方案
方法:方案一 有3个publications,每个人数在20到50不等,方案二 也有3个
publications(不同),每个人数在10到30。outcomes都看了 术后并发症 这也是我感兴
趣的
问题:怎样把这六个single arm study整合成comparison study?
我的考虑:1,最naive的方法 把同一手术方案的人combine 一起 做chisq test
2:按照meta analysis思路 按sample size给每个study加weight 然后 combine 同一
手术方案的病人 做chisq test
这两个方案可行否 大家帮分析分析
另外还有什么办法可以做
如果按meta analysis思路 degree freedom怎么算
多谢 |
|
e**p 发帖数: 4259 | 18 【 以下文字转载自 Statistics 讨论区 】
发信人: eucp (Inner peace), 信区: Statistics
标 题: 生统的Dr.PH是什么样的一个水平?
发信站: BBS 未名空间站 (Mon Sep 16 22:57:43 2013, 美东)
老板在我休假的时候,招了个Dr.PH in biostatistics,印度人,是那种带有方向(
southern之类的)的学校毕业的,不知道是州立的还是community college,我没有参加
面试。
她上班第一天,我问她会什么,说dissertation做的是missing data, 比较normal
distribution,chisq distribution, T distribution data,用multiple imputation
的方法来做,有啥优缺点。。。然后问她,用什么软件做的,她说用的是SAS,data哪
来的,simulate的,时间关系,我没有继续问她毕业论文的问题
然后问她,除了SAS,会其他软件么?说会R,我问,会METLAB,C++等么,回答“不会
”,然后继续问,会u... 阅读全帖 |
|
A*****a 发帖数: 52743 | 19 用你的gut feeling说说13-3会和8-8不同么?
我懒得用R, 直接用excel的chisq.test的函数算的,你的结果居然会差一个小数点?
than
close. |
|
t**k 发帖数: 139 | 20 Gut feeling is not accurate. People tend to focus more on the mean
differences but ignore the variances.
I never used excel. You can use any online chisq test calculator to confirm
the p-value. If Excel really gives you that number, it only shows that M$
sucks. |
|
g**a 发帖数: 2129 | 21 correlation?fisher's exact test啊。人数这么多直接chisq也行啊。
[在 chunjuan (👍春卷🐱更多春卷👍) 的大作中提到:]
:【 以下文字转载自 SanFrancisco 讨论区 】
:发信人: madmony (carpe diem), 信区: SanFrancisco
:........... |
|
h******b 发帖数: 312 | 22
Thanks for pointing that out! I might be wrong, but my understanding is from
gardenia's original post:
>打个比方我做一个实验,3种treatment A B C
>做了4次实验
my understanding is that gardenia did the first experiment, treat cell with A,
B, and C, then record counts, then she repeats, culture cells again, treat
with A, B, and C then record counts, and she(?) did it 4 times.
I guess I might confused you by use the whole data to do the chisq and fisher
test in the last portion of my post. That's not the answer to |
|
p******n 发帖数: 874 | 23 R: fisher.test chisq.test |
|
g**********y 发帖数: 423 | 24 我得到这个数据
CellTypeI CellTypeII CellTypeIII
Hypermethylated 5400 1600 500
Hypomethylated 450 1500 150
用Fisher exact test or chisq test只能说明methyaltion和CellType是相关的。
但是不能表明CellType中的哪种enriched with hyper or hypo-methylation。
显然,CellTypeI中Hypermethylated的数目比较多,要用什么test来说明
CellTypeI is significantly enriched with Hypermethylation。
另外 Is CellTypeII enriched with Hypomethylation?
Thanks!!! |
|
j********e 发帖数: 52 | 25 Fisher's test is only for binary 2x2 table, use chisq test to test
association between CellType and methylation.
WITHIN each cell type, use binomial test to test if the cell type is
enriched with hypermethylation. This can be done by either calling test
procedures or by permutation. For example, in R |
|
m******r 发帖数: 1033 | 26 人家说的是common sense, 要多看书啊。
我的一点粗浅理解是:一两百年前几位统计学大牛fisher啦,皮尔逊啦,等等深刻理解
了统计学的本质,提出了三四个分布,足以概括大部分(线性)统计学。 这就是人家
的牛逼之处。 有点像牛顿发明三定律, 阿基米德发明几何学一样,三言两语,几条公
理,完美的解释了你生活的世界。
不服不行。
我想这几位大牛当初脑子里肯定想过其他稀奇古怪的分布,最后认定norm/chisq/t, 类
似于点线面的地位。 |
|
m*********s 发帖数: 20 | 27 I run a logistic regression with 4 groups of population. The SAS gave me 3
intercepts with several expected parameters for independent variables like
this:
Parameter DF Estimate Chi-Square Pr > ChiSq
Intercept1 1 -1.2821 0.2213 0.2189
Intercept2 1 -6.4327 0.2768 0.6587
Intercept3 1 -5.3247 8.2312 0.0085
CS1 1 23. |
|
f**y 发帖数: 368 | 28 linear fit a+bx through several points (x,y), each y point has an error bar
fitting result give a, b, and the following para:
YBAND
1 standard deviation error estimate for each point.
YERROR
standard error between YFIT and Y.
YFIT
vector of calculated Y values. These values have an error of + or - YBAND.
CHISQ
value of the unreduced chi-square goodness-of-fit statistic
SIGMA
1-sigma uncertainty estimates for the returned parameters
now suppose a+bx line intersect with X asix at a point S with (s |
|
D******n 发帖数: 2836 | 29 chisq test
MI is for two discrete random variables |
|
|
jl 发帖数: 398 | 31 QQ plot is non-formal graphical check. |
|
|
h******e 发帖数: 1791 | 33 用stepwise的方法选择变量,得到两个A和B,都是continuous的,两者之间的
interaction被排除了,如下:
Parameter DF Estimate SE Wald Pr>ChiSq
A 1 0.1297 0.0435 8.9076 0.0028
B 1 -0.3586 0.1732 4.2843 0.0385
可见两者的作用是相反的。
但如果单独用A或B做logistic model,得到:
A的estimate是0.0565,B的estimate是0.1665,两者的作用是同向的。如果单独对二者
做linear regression的话,发现存在正相关性。
请问该如何解释logistic regression的结果。谢谢。 |
|
h******e 发帖数: 1791 | 34 前辈,有这么一个logistic regression的问题,请帮帮忙:
In this logistic regression (real clinical data) with 22 severe diseased and
25 less diseased, I used stepwise method to select covariates with SAS
procedure logistic. The objective is to examine variables which could cause
disease progression. I finally got two: A and B. Both are continuous. Their
interaction A*B was ruled out by the SAS procedure.
Parameter DF Estimate SE Wald Pr>ChiSq
A 1 0.1297 0.0435 |
|
m****r 发帖数: 237 | 35 这个问题不是很明确。。不过看你的意思应该是在test if the data follows a poiss
on distribution or not.
Chisq-test can be used to test whether a random variable is from some specif
ied distribution, for instance, poisson in your case.
Your p-value here is between 0.5 and 0.9, you can't reject your null hypothe
sis, which is the data follows poisson distribution. That's how you get your
result.
There is a theorem behind this. You can google for chi-square test for it. O
ne of the application of Chi-square test |
|
a***r 发帖数: 420 | 36 刚用自己的数据试了,两个都可以run(废话。。。)
个人感觉songkun的方法思路比较简明,而且放之四海而皆准
左外野的方法需要多写几句把通过which得到的r,c指定进去,但是这样得到的
findname这个matrix要短得多,不知在数据很多的时候会不会是显著优势
谢谢大家!!
现在的老板总是说,R cannot handle too large a matrix...一直比较不以为然,不
过有一次我试图做1500个pairwise的LRT,然后把chisq放到一个1500*1500的matrix里
,5个小时还没跑出来。。。大家觉得R能handle多大的database?
, |
|
a***r 发帖数: 420 | 37 把结果(p和chisq)分别放到一个上三角matrix里,然后把p小于0.05的导出来,当时
的导出程序见顶楼。。。blush。。。 |
|
a***r 发帖数: 420 | 38 我其实就是用这个格式存的:)在原帖里把问题改了一下,想显得general一点(呃,
似乎有点多余。。。)
不过,你说的把所有结果都导出到这个X矩阵然后再找,其实就是songkun的思路啊~
嗯,我关于那个1500*1500说得不够清楚
数据结构是这样的
obs Y x1 x2 x3... var1500
1 1 1 0 2 ...
2 0 2 1 0 ...
...
Y是0/1 categorical variable
x可以看成numeric variable
然后我想知道的,是对于所有x的pairwise的组合,增加一个interaction term对原
model的improvement,即
nested model: y=x1+x2
full model:y=x1+x2+x1x2
然后对每对做log likelyhood ratio test,得到相应的chisq和P
因为是preliminary study,想得到一个尽量inclusive的list |
|
x********u 发帖数: 64 | 39 比如说有2个变量 x1 x2
x1 有2个level
x2 有3个level
然后有个resp变量y
有2个level
应该怎么run 那个proc freq呢?
data test;
input y $ x1 $ x2 $ count ;
datalines;
N e b 2398
N e m 3686
N e t 3004
N m b 4549
N m m 7653
N m t 4853
Y e b 58
Y e m 82
Y e t 77
Y m b 130
Y m m 172
Y m t 114
;
run; |
|
w**********r 发帖数: 986 | 40 proc freq;
table resp*x1*x2; * or any order you want;
run; |
|
P**********c 发帖数: 17 | 41 最土的方法,呵呵。case太多了,肯定就效率低了。再想想有没有更高效一点的方法。
data temp;
do i=1 to 2398;
y="N";x1="e";x2="b";output;end;
do i=1 to 3686;
y="N";x1="e";x2="m";output;end;
do i=1 to 3004;
y="N";x1="e";x2="t";output;end;
do i=1 to 4549;
y="N";x1="m";x2="m";output;end;
do i=1 to 7653;
y="N";x1="m";x2="t";output;end;
do i=1 to 4853;
y="N";x1="e";x2="m";output;end;
do i=1 to 58;
y="Y";x1="e";x2="b";output;end;
do i=1 to 82;
y="Y";x1="e";x2="m";output;end;
do i=1 to 77;
y="Y";x1="e";x2="t";output;end;
do i=1 to 130;
y="Y";x |
|
x********u 发帖数: 64 | 42 thanks
那结论就是x1和x2这2个variable都对y没有影响吗?
Summary Statistics for col by mis
Controlling for row
Cochran-Mantel-Haenszel Statistics (Based on Table Scores)
Statistic Alternative Hypothesis DF Value Prob
1 Nonzero Correlation 1 0.9728 0.3240
2 Row Mean Scores Differ 2 3.7930 0.1501
3 General Association 2 3.7930 0.1501 |
|
c****s 发帖数: 63 | 43 在SAS中得到了下面的结果,请问这个model是好还是不好呢?
这是一个logistic regression model,predictors 是由很多dummy variables组成的。
Deviance and Pearson Goodness-of-Fit Statistics
Criterion Value DF Value/DF Pr > ChiSq
Deviance 1950.8899 3133 0.6227 1.0000
Pearson 4567.9687 3133 1.4580 <.0001 |
|
n******0 发帖数: 298 | 44 The outcome is Cancer vs. Normal
The explanatory varibles are four protomics peaks
The following is the results:
Analysis of Maximum Likelihood Estimates
Standard Wald
Parameter DF Estimate Error Chi-Square Pr >ChiSq
Intercept 1 -1.7465 1.4500 1.4509 0.2284
c14 1 -2.4761 0.8573 8.3430 0.0039
c25 1 7.7777 2.4119 10.3987 0.0013
c46 |
|
|
s*****n 发帖数: 2174 | 46 There is no easy way to test independence as far as I am aware of.
Pearson's test, Spearmean Rho, Kendall's Tau are all testing correlation.
The definition of independence is too strong for any parametric and
nonparametric approaches. The best approach I can think about is to
partition the X and Y range into small pieces and test as discrete variables
(such as Chisq test). Of course, this will require large sample size.
try |
|
x*******i 发帖数: 1590 | 47 我 run proc genmod, 有一个contrast statement
CONTRAST a*b 0 0 0 0 1 -1;
but in sas log
"WARNING: The contrast will not be tested due to some rows being
nonestimable."
output is
Contrast Results for GEE Analysis
Chi-
Contrast DF Square Pr > ChiSq Type
0 . . Score
不知道这个some rows being nonestimable是什么?有牛人帮个忙吧。 |
|
|
g**********t 发帖数: 475 | 49 去掉括号,比如输入t.test就可以了。
不过t.test的源代码不能直接看,因为貌似t.test只是一个wrapper function。你可以
用chisq.test做例子试一试。 |
|
l*****k 发帖数: 587 | 50 Assume G variables, each variable can be positive or negative
group A, a subgroup of G
group B, a subgroup of G
the same variable in A and B can have different values (both positive,
or negative, or one positive or one negative)
I wonder if there is a way to give a P value to how A and B overlap,
considering positive or negative (direction only).
All I can think about is to take their overlap, then calculate chisq
based on contingency table (positive/negative) of A and B.
Not sure if there are o... 阅读全帖 |
|