freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

從數(shù)據(jù)到結(jié)論(人民大學(xué)吳喜之教授)14統(tǒng)計(jì)軟件和r語(yǔ)言(參考版)

2025-05-04 23:42本頁(yè)面
  

【正文】 attach(Animals) ?plot(body, brain) ?plot(sqrt(body), sqrt(brain)) ?plot((body)^, (brain)^) ?plot(log(body),log(brain)) 0 20220 40000 60000 800000100030005000bodybrain0 50 100 150 200 250 3000204060s q r t ( b o d y )sqrt(brain)1 . 0 1 . 5 2 . 0 2 . 5 3 . 01.01.52.0( b o d y ) ^ 0 . 1(brain)^0.10 5 1002468l o g ( b o d y )log(brain)畫圖 (原始數(shù)據(jù) ) ? par(mfrow=c(1,1), pch=1) ? plot(body, brain, xlim=c(0, 6000)) ? text(x=body, y=brain,labels=(Animals), adj=0) adj=0 implies left adjusted text 0 1000 2022 3000 4000 5000 6000010002022300040005000bodybrainM o u n t a i n b e a v e rC o wG r e y w o l fG o a tG u i n e a p i gA si a n e l e p h a n tD o n ke yH o r seP o t a r m o n ke 。 s L a wc o m p r e s s i o ndistanceI a m h e r e !I a m h e r e !畫圖 ?library(mass)。 s L a wxy1234567840 42 44 46 48 50 52120130140150H o o k e 39。s Law) 只有標(biāo)題 的圖 ? text(locator(2), I am here!) 在點(diǎn)擊的兩個(gè)位置寫入文字 40 42 44 46 48 50 52120130140150H o o k e 39。s Law, xlab= x,ylab= y) 標(biāo)題 +x,y標(biāo)記 ? identify(pression,distance) 標(biāo)出點(diǎn)號(hào)碼 ? plot(pression, distance,main=Hooke39。id=id+1 break} id=id+1} list(pattern=pattern,number=nu,id=id) } R語(yǔ)言畫圖 x=0:18 plot(x,x,pch=x,col=x) points(x,18x,pch=x) matplot(x,cbind(x,18x)) 畫圖 ? spring= (pression=c(41,39,43,53,42,48,47,46), distance=c(120,114,132,157,122,144,137,141)) ? attach(spring) ? (Hooke?s law: f=.5ks) ? plot(distance ~ pression) ? plot(pression, distance) 畫圖 ? par(mfrow=c(2,2))準(zhǔn)備畫 2?2的 4個(gè)圖 ? plot(pression, distance,main= Hooke39。nu=c(nu,sum(z2)) if (sum(nu)=n)break if ((z0)==F) {nu=c(nu,1)。id=1。pattern=NULL z0 =(z)。 (default), only\n newlines created explicitly by 解釋后面語(yǔ)句的意思 n=1200。 (default), only + newlines created explicitly by) [1] a logical or (positive) numeric controlling how the output is\n broken into successive lines. If 39。 (default), only newlines created explicitly by if(all(x 0)) print(all x values are negative\n) [1] all x values are negative\n print(a logical or (positive) numeric controlling how the output is + broken into successive lines. If 39。 (default), only + newlines created explicitly by\n) a logical or (positive) numeric controlling how the output is broken into successive lines. If 39。all(y==x) [1] TRUE cat 和 print if(all(x 0)) cat(all x values are negative\n) all x values are negative cat(a logical or (positive) numeric controlling how the output is + broken into successive lines. If 39。biplot(corresp(a, nf=2))應(yīng)用之一 上一頁(yè)數(shù)據(jù)中變量的屬性和定量標(biāo)簽的互換 (DF[,2]) [1] TRUE (DF[,3]) [1] TRUE (DF[,4]) [1] FALSE DF[,4]=(DF[,4]) (DF[,4]) [1] TRUE DF[,4]=(DF[,4]) (DF[,4]) [1] FALSE 在用啞元記錄屬性變量觀測(cè)時(shí),如不改變標(biāo)簽,則可能出錯(cuò) mtcars[1:4,] mpg cyl disp hp drat wt qsec vs am gear carb Mazda RX4 6 160 110 0 1 4 4 Mazda RX4 Wag 6 160 110 0 1 4 4 Datsun 710 4 108 93 1 1 4 1 Hor 4 Drive 6 258 110 1 0 3 1 lm(mpg~gear+carb,mtcars) 把定性變量當(dāng)成定量變量 Call: lm(formula = mpg ~ gear + carb, data = mtcars) Coefficients: (Intercept) gear carb mtcars[,10]=(mtcars[,10]) 改變標(biāo)簽 mtcars[,11]=(mtcars[,11]) 改變標(biāo)簽 (lm(mpg~gear+carb,mtcars)) Call: lm(formula = mpg ~ gear + carb, data = mtcars) Coefficients: (Intercept) gear4 gear5 carb2 carb3 carb4 carb6 carb8 向量比較: all x=1:12。print(c(i,x)) 怎么調(diào)出 Packages來(lái)使用 ? Packages:libraries 敲 library(),就知道有什么 libraries了 ,缺省 library是 mass,就敲 library(mass) 每個(gè) library都有許多數(shù)據(jù) 在每個(gè) library敲 data(),就知道有什么數(shù)據(jù)了 比如敲 data(Titanic),就調(diào)出數(shù)據(jù) Titanic來(lái)了 . 注意 :R語(yǔ)言對(duì)大小寫敏感 . 怎么從網(wǎng)上下載 Packages來(lái)使用 ? 從 R上網(wǎng)直接到 CRAN主頁(yè) 下載 zip文件到你的計(jì)算機(jī) 用本機(jī)的 zip來(lái)安裝程序包 … by attach(warpbreaks) by(warpbreaks[, 1:2], tension, summary) by(warpbreaks[, 1], list(wool = wool, tension = tension), summary) now suppose we want to extract the coefficients by group tmp by(warpbreaks, tension, function(x) lm(breaks ~ wool, data = x)) sapply(tmp, coef) %in%和 match The intersection of two sets : intersect function(x, y) y[match(x, y, nomatch = 0)] intersect(1:10,7:20) 1:10 %in% c(1,3,5,9) sstr c(c,ab,B,bba,c,bla,a,Ba,%) sstr[sstr %in% c(letters,LETTERS)] %w/o% function(x,y) x[!x %in% y] x without y (1:10) %w/o% c(3,7,12) intersect function(x, y) y[match(x, y, nomatch = 0)] intersect(1:10,7:20) attach(warpbreaks) warpbreaks[tension%in% c(L,H),] warpbreaks[warpbreaks$tension%in% c(L,H),] warpbreaks[warpbreaks[,3]%in% c(L,H),] unique(tension) ftable:把 array/矩陣(沒有頻率的) 數(shù)據(jù)變成列聯(lián)表(找出計(jì)數(shù)) Start with a contingency table. ftable(Titanic, = 1:3) ftable(Titanic, = 1:2, = “Survived”) ftable(Titanic, = 2:1, = “Survived”) Start with a data frame. x ftable(mtcars[c(“cyl”, “vs”, “am”, “gear”)]) x 為 array,其維的次序?yàn)?(“cyl”, “vs”, “am”, “gear”) ftable(x, = c(2, 4))從 x( array)確定表的行變量 Start with expressions, use table()39。if(x3)break。x=rnorm(1)。i=i+1} ?x=rnorm(1)。x=NULL。amount = scan() ?5 5 5 13 7 11 11 9 8 9 11 8 4 5 9 5 10 5 4 10 ?category = scan() ?1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 ?boxplot(amount ~ category) note the tilde ~ 從文本文件輸入 ASCII碼數(shù)據(jù) ? x=scan(f:\\book\\) ? 這是按照文本一行一行讀入的數(shù)據(jù) ? 如果原先是 4?5矩陣形式 ,則加用 ? x=matrix(x,4,5,byrow=T)或 直接用 ? x= matrix(scan(f:\\book\\),4,5,
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1