2010年7月18日 星期日

Re: [問題] [SPSS]如何畫 Chi-Square plot?

作者: chungyuandye (養花種魚數月亮看星星) 看板: Statistics
標題: Re: [問題] [SPSS]如何畫 Chi-Square plot?
時間: Sat Mar 22 13:32:52 2008

※ 引述《magicfx (去南半球度假)》之銘言:
: 找來找去
: 好像沒有這個選項
: 只有找到別人用 SAS 寫的 code
: 可是我想要用 SPSS 來畫 chi-square plot
: 請問有這類的 add-ons 可以下載嗎?

SET MXLOOP =99999.
MATRIX.
GET DATA/VARIABLES=X1 to Xp/MISSING=OMIT.
COMPUTE NR=NROW(DATA).
COMPUTE NC=NCOL(DATA).
COMPUTE MEAN=T(CSUM(DATA)/NR).
PRINT MEAN.
COMPUTE SIGMA=(SSCP(DATA)-NR*MEAN*T(MEAN))/(NR-1).
PRINT SIGMA.
COMPUTE MD=MAKE(NR,2,-999).
COMPUTE MDTEMP=MAKE(NR,1,-999).
LOOP I=1 TO NR.
- COMPUTE MD(I,1)=DATA(I,:)*INV(SIGMA)*T(DATA(I,:)).
END LOOP.
COMPUTE MD(:,2)=(RNKORDER(MD(:,1))-0.5)/NR.
SAVE MD /OUTFILE=*.
END MATRIX.
RENAME VARIABLES COL1= MD COL2= CHISQUARE.
GRAPH
/SCATTERPLOT(BIVAR)=MD WITH CHISQUARE /MISSING=LISTWISE
/TITLE= 'The chi-square plot of the ordered distances.'.

不知道有沒有錯,有錯請指教。

Reference:
http://ieeexplore.ieee.org/iel5/8766/27769/01237706.pdf?arnumber=1237706

--
養花種魚數月亮賞星星

http://www.google.com.tw/search?hl=zh-TW&q=spss+box+cox&btnG=Google


--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.232.189.101
※ 編輯: chungyuandye 來自: 118.232.189.101 (03/22 13:39)
※ 編輯: chungyuandye 來自: 118.232.189.101 (03/22 13:56)
推 magicfx:喔謝謝 我今晚來研究一下  03/24 19:57

Re: [問題] 複選題轉成連續變項

作者: chungyuandye (養花種魚數月亮看星星) 看板: Statistics
標題: Re: [問題] 複選題轉成連續變項
時間: Fri Mar 21 12:32:31 2008

※ 引述《cansansiow (我)》之銘言:
: 問卷題目為:在這段期間,請問您有沒有去參加下列活動?(複選)
: 1、捐錢 2、穿紅衣 3、靜坐 4、915圍城 5、天下圍攻 6、遍地開花
: 92、沒有 95、拒答
: 今欲以此為多元迴歸之依變項,參加一項得一分,兩項得兩分...以此類推,請問眾
: 強者們,要如何將此名目變項轉換成連續變項?
: 謝謝~

Q1_1=捐錢, Q1_1=1:有選;Q1_1=0:沒選
其他的依此類推

開啟一個syntax檔,

IF (Q1_95 = 0) temp=Q1_1+Q1_2+Q1_3+.....Q1_92.
EXECUTE.

工具列=>Run=>All

--
養花種魚數月亮賞星星

http://chungyuandye.blogspot.com

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.232.189.101
推 cansansiow:謝謝歐  03/21 21:13

[自動轉寄] Re: [問題] [SPSS]Q-Q plot 的 X/Y 軸如何對調?

作者: chungyuandye (養花種魚數月亮看星星) 看板: Statistics
標題: Re: [問題] [SPSS]Q-Q plot 的 X/Y 軸如何對調?
時間: Sun Mar 16 17:10:52 2008

※ 引述《magicfx (去南半球度假)》之銘言:
: 我想要把 SPSS 16 產生的 Q-Q plot 的 observed value 和 expected value 對調
: SPSS 預設把 Observed value 放在 x 軸
: expected value 放在 y 軸
: 但是我想要把 Observed value 改放在 y 軸
: expected value 放在 x 軸
: 請問該怎麼做呢?

不知道其他版本可不可以,SPSS 16是可以

Step 1. 先畫出Q-Q Plot

Step 2. 在Q-Q Plot上點兩下,進入圖形編輯

Step 3. 在Y軸上點兩下,選擇滑鼠右鍵

Step 4. Transpose Chart

只是這樣作,有什麼特別意義??

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.232.189.101
推 magicfx:只是要跟課本的表達方式一致罷了 , 3q  03/17 23:43

[自動轉寄] Re: [問題] 迴歸裡的多元共線

作者: chungyuandye (chungyuandye) 看板: Statistics
標題: Re: [問題] 迴歸裡的多元共線
時間: Sat Jan 28 10:58:19 2006

※ 引述《latique (Afro)》之銘言:
: ※ 引述《sevenkiller (惡狠很的一發)》之銘言:
: : 就是自變項間是否有高度相關
: : 如果自變項間高度相關的話 會影響到對迴歸係數之假設檢測
: : 實際上操作的話 SPSS所提供之collinearity的統計包括
: : Tolerance VIF和Condition Index等
: : 這些統計是有關連性的 如Tolerance與VIF就是互為倒數 如果是Tolerance越小
: : 就表示該自變項與其他自變項間之共線性越高
: : 總而言之 共線性在分析當中是低比較好 共線性一高 就代表你的迴歸有問題
: : 解釋起來就很麻煩了
: 所以當各自變項出現共線性的關係
: 表示之間有高度相關
: 對於解釋依變項也較沒有解釋力的意思嗎∼∼

Y=b0+b1*X1+b2*X2+....+bk*Xk

Xi=c0+c1*X1+c2*X2+..+c_{i-1}*X_{i-1}+c_{i+1}*X_{i+1}+..ck*Xk
這邊可以算出一個R^2

VIF_i=1/(1-R^2)

VIF_i值很大(通常以10為門檻), 表示該自變數能被其他自變數所取代,
所以它可以不需要列在解釋變數

B=Inverse(X^T*X)*X^T*Y
如果是完全共線性, 那個X^T*X這個矩陣裡至少有兩行的元素等比例
所以行列式值為0, 那麼Inverse就不存在, 因此估計出來的B也會沒意義

應該是這樣子, 有錯請指正


--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 222.250.191.69

2010年7月4日 星期日

Fwd: how to tell Mathematica to display x^-1 as x^-1 and not as 1/x

---------- Forwarded message ----------
From: "Sjoerd C. de Vries" <sjoerd.c.devr...@gmail.com>
Date: 7月4日, 下午3時08分
Subject: how to tell Mathematica to display x^-1 as x^-1 and not as 1/
x
To: comp.soft-sys.math.mathematica


Hi Nasser,

I think the construction below should work. I don't have much
experience with this, but I couldn't find any side effect.

Unprotect[Power];
Power /: MakeBoxes[Power[x_, y_], StandardForm] :=
 RowBox[{MakeBoxes[x, StandardForm], "^", MakeBoxes[y, StandardForm]}]
Protect[Power];

Cheers -- Sjoerd

On Jul 3, 2:19 pm, "Nasser M. Abbasi" <n...@12000.org> wrote:

> Hello;

> When I type

> x^-1

> Mathematica replies

> 1/x

> Is there a way to tell Mathematica to *display* terms with negative
> powers as  x^-n  and not as 1/x^n ? (i.e keep the term just like it
> would appear on paper).

> Another example, suppose I type

> expr = a*x^-2 + b *x^-1 +

> The reason I want to do this, is just for display purposes. When I print
> the expression on the screen, I'd like it to look like x^-1 and not like
> 1/x (to better match how the expression look like in the textbook)

> I am trying to avoid having to convert everything to a string, and force
> the form to the way I want.  I tried Hold functions, and
> TraditionalForm, but can't get it to print as I want.

> I am hoping there is an easy trick to do this?

> thanks
> --Nasser

Fwd: Is it possible to query current plot range values (or have

---------- Forwarded message ----------
From: Bill Rowe <readn...@sbcglobal.net>
Date: 7月4日, 下午6時10分
Subject: Is it possible to query current plot range values (or have
To: comp.soft-sys.math.mathematica


On 7/4/10 at 3:10 AM, dnqu...@gmail.com (Leo Alekseyev) wrote:

>Some of my plots contain vertical lines for alignment.  To make sure
>the lines extend from the top to the bottom of the plot frame, I
>typically give those lines large values for +y and -y coordinates.
>This has an unfortunate side effect that the directive
>PlotRange->All now considers my line to be a part of the plot, and
>rescales the plot range to display it in its entirety.  Is there a
>way to (a) either make PlotRange->All ignore this line somehow or
>(b) set the +y and -y coordinates of the line to match the current
>plot range?..

Here are two ways to place a vertical line on a plot without using
large coordinate values for y:

Plot[Cosh[x], {x, -5, 5},
 Epilog -> {Red, Line@{Scaled@{.8, 0}, Scaled@{.8, 1}}}]

or

Plot[Cosh[x], {x, -5, 5}, GridLinesStyle -> Red,
 GridLines -> {{3}, None}]

(shihori) Re: [其他]mathematica計算問題

作者: chungyuandye (養花種魚數月亮賞星星)
標題: Re: [其他]mathematica計算問題
時間: Sun Jul 4 22:29:39 2010

※ 引述《shihori (^^)》之銘言:
: 1.題目:Find the maximum of the function
: f(x ; y) = y
: subject to the constraint 395x-100y = 20 ; x,y皆為整數
: ans: y=1169 x=296
Maximize[{y, 395 x - 100 y == 20, 200 < x < 300, y > 0,
Element[x | y, Integers]}, {x, y}]

Reduce[{395 x - 100 y == 20, 200 < x < 300, y > 0}, {x, y},
Integers] /. {x_ == z1_ -> z1, y_ == z2_ -> z2, And -> List,
Or -> List}

: 2.求 [x^2] - [x] - 6 < 0 ;[]為高斯函數
: ans: -1 ≦ x < 3

Reduce[{Floor[x^2] - Floor[x] - 6 < 0}, x, Reals]
答案應該有錯!
{Floor[x^2] - Floor[x] - 6 < 0} /. x -> 2.9

: 3.求y=ln(x) 中x的的定義域y的值域
: 想問一下程式要怎麼寫才能表示出來?
: 4.解不等式 sin(x- π/6) >cos(x) ;0≦x<2π
: 但答案是 π/3 < 4π/3 ,跟程式跑出來的答案π/3 < 2π有出入
Reduce[{Sin[x - \[Pi]/6] > Cos[x], 0 <= x < 2 Pi}, x]

--
養花種魚數月亮賞星星

http://cydye1069.blogspot.com

--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.173.131.15