Skip to Content
R 錦囊妙計
book

R 錦囊妙計

by Paul Teetor
January 2014
Beginner to intermediate
488 pages
8h 1m
Chinese
GoTop Information, Inc.
Content preview from R 錦囊妙計
13.7 預測二元變數(羅吉斯迴歸)
|
387
> plot(x ˜ factor(means), main="Original Clusters", xlab="Cluster Mean")
> plot(x ˜ factor(clust), main="Identified Clusters", xlab="Cluster Number")
如圖 13-3 所示的盒鬚圖。集群演算法完美地將資料分割為不重疊的組。原來的集群相互
重疊,而新界定的集群則不會相互重疊。
13-3 集群比較圖
上列圖形使用一維資料,但是
dist
函數同樣適用於處理儲存在資料框架或矩陣的多維資
料。資料框架或矩陣中的每一列資料被視為多維空間中的一個觀測值,而
dist
函數計算
這些觀測值之間的距離。
延伸資訊
此範例是基於 R 軟體集群功能的基礎套件;尚有其他套件(如:
mclust
套件)能提供替
代的集群機制。
13.7 預測二元變數(羅吉斯迴歸)
問題點
您想要執行
羅吉斯迴歸
logistic regression
,即用來預測二元選擇事件發生機率的迴歸
模型。
388
|
第十三章
解決方案
使用
glm
函數,並設定
family=binomial
來執行羅吉斯迴歸。其輸出結果是個模型物
件:
> m <- glm(b ˜ x1 + x2 + ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

R 语言经典实例(原书第 2 版)

R 语言经典实例(原书第 2 版)

J.D. Long, Paul Teetor
優雅的SciPy|Python科學研究的美學

優雅的SciPy|Python科學研究的美學

Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9789862769829