_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › Histogram
|
|
[edit]
2 蟆轟蠏碁Μ蠍 #rgb()襦 rgb(red, green, blue, alpha ..) 蟾, 覈襯 譟一.
hist(iris[iris$Species =="setosa", 1], col="grey", xlim=range(iris$Sepal.Length), ylim=c(0,25)) hist(iris[iris$Species =="versicolor", 1], col=rgb(1, 0, 0, 0.5), add=TRUE) hist(iris[iris$Species =="virginica", 1], col=rgb(0, 1, 0, 0.5), add=TRUE) [edit]
3 hist boxplot 豢螳蠍 #hist(iris$Sepal.Length) sfsmisc::histBxp(iris$Sepal.Length) library(packHV) hist_boxplot(iris$Sepal.Length) [edit]
4 hist line 豢螳蠍 #覦覯: https://cran.r-project.org/doc/contrib/Lemon-kickstart/kr_adlin.html
rescale<-function(x,newrange) { if(nargs() > 1 && is.numeric(x) && is.numeric(newrange)) { # if newrange has max first, reverse it if(newrange[1] > newrange[2]) { newmin<-newrange[2] newrange[2]<-newrange[1] newrange[1]<-newmin } xrange<-range(x) if(xrange[1] == xrange[2]) stop("can't rescale a constant vector!") mfac<-(newrange[2]-newrange[1])/(xrange[2]-xrange[1]) invisible(newrange[1]+(x-xrange[1])*mfac) } else { cat("Usage: rescale(x,newrange)\n") cat("\twhere x is a numeric object and newrange is the min and max of the new range\n") } } set.seed(1) val1 <- rnorm(50) set.seed(100) val2 <- rnorm(100) + 5 val <- c(val1, val2) h <- hist(val) plot(h) lines(rescale(spline(h$counts)$x, range(h$mids)), spline(h$counts)$y) [edit]
6 覿(ろ蠏碁) #企 一危郁 豌 譴 谿讌 豺襯 願鍵 伎 豌 蟆渚レ 殊 襷れ 譴. 豌 蟆渚レ 磯 覿螳 襷れ . 覿 れ螻 螳 覦覯朱 襷 .
[edit]
7 ろ讌 覦覯 #
DECLARE @k int , @r bigint , @avg bigint , @sigma bigint , @min bigint , @max bigint , @cnt int , @min_real bigint , @max_real bigint --1 + (LOG10(N) / LOG10(2)) SELECT @sigma = STDEV(Score) , @avg = AVG(Score) , @min_real = MIN(Score) , @max_real = MAX(Score) FROM #Score -- 伎豺 蟇壱 蟲螳 蟲.: 蠏 - (1.5 * 譴ク谿) ~ 蠏 + (1.5 * 譴ク谿) SELECT @r = (MAX(Score) - MIN(Score)) / (1 + (LOG10(COUNT(*)) / LOG10(2))) , @k = (1 + (LOG10(COUNT(*)) / LOG10(2))) , @cnt = COUNT(*) , @min = MIN(Score) , @max = MAX(Score) FROM #Score WHERE Score > @avg - (3 * @sigma) AND Score < @avg + (3 * @sigma) ;WITH Dumy(Seq) AS ( SELECT 1 Seq UNION ALL SELECT Seq + 1 FROM Dumy WHERE Seq + 1 <= @k ), Grade AS ( SELECT (@k - Seq ) + 1 Grade , @min + ((Seq-1) * @r) BeginScore , @min + (Seq * @r) EndScore FROM Dumy ), RealGrade AS ( SELECT Grade, BeginScore, EndScore FROM Grade UNION ALL SELECT Grade + 1, @min_real, EndScore + 1 FROM Grade WHERE Grade = (SELECT MAX(Grade) FROM Grade) UNION ALL SELECT Grade - 1, BeginScore + 1, @max_real FROM Grade WHERE Grade = (SELECT MIN(Grade) FROM Grade) ) SELECT B.Grade , COUNT(*) AccountCnt , SUM(NetAMT) NetAMT FROM #Score A INNER JOIN RealGrade B ON A.Score BETWEEN B.BeginScore AND B.EndScore GROUP BY B.Grade ORDER BY 1 [edit]
8 譴ク谿襯 伎 覦覯 #
譴蠏覿 谿瑚襦 '6蠏碁' 蠏碁 蠏碁手骸 螳 詞 危螻 . 6蠏碁 (亮 - 6) ~ (亮 + 6) 蟲螳 詞 碁.
[edit]
9 5螻 螳 # 蠏覿 れ螻 螳 5螳 蟲螳朱 .
[edit]
11 R 伎 ろ蠏碁 #x <- rnorm(100) xnm <- "蠏覿" hist(x, labels=TRUE, main = paste("Histogram of" , xnm), xlab = xnm) x <- rnorm(1000) hist(x, probability=T) lines(density(x)) [edit]
12 蠏碁9覲襦 #install.packages("sm") library("sm") y <- c(1,2,3) levels(x9$lf_group) <- c("group1", "group2", "group3") sm.density.compare(x9$frd_cnt, x9$lf_group) legend("topright", levels(x9$lf_group), fill=2+(0:nlevels(x9$lf_group))) library("ggplot2") diamonds_small <- diamonds[sample(nrow(diamonds), 1000), ] ggplot(diamonds_small, aes(depth, fill = cut)) + geom_density(alpha = 0.2) + xlim(55, 70) |
蟾 讌襯 螳螻 朱 襦 蠍 螳 企 襷 焔 蟆 蟆企. (ろ) |