1.2.3-SNAPSHOT permalink Arrow_down_16x16

qq-plot

incanter.charts

  • (qq-plot x & options)

Returns a QQ-Plot object. Use the 'view' function to display it.

References:
http://en.wikipedia.org/wiki/QQ_plot

Examples:

(use '(incanter core stats charts datasets))
(view (qq-plot (sample-normal 100)))
(view (qq-plot (sample-exp 100)))
(view (qq-plot (sample-gamma 100)))

(with-data (get-dataset :iris)
(view (qq-plot :Sepal.Length)))



0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/charts.clj:2632 top

(defn qq-plot
"
  Returns a QQ-Plot object. Use the 'view' function to display it.

  References:
    http://en.wikipedia.org/wiki/QQ_plot

  Examples:

    (use '(incanter core stats charts datasets))
    (view (qq-plot (sample-normal 100)))
    (view (qq-plot (sample-exp 100)))
    (view (qq-plot (sample-gamma 100)))

    (with-data (get-dataset :iris)
      (view (qq-plot :Sepal.Length)))



"
  ([x & options]
   (let [opts (when options (apply assoc {} options))
	 data (:data opts)
	 _x (if (coll? x) (to-list x) ($ x data))
	 n (count _x)
         quants (for [k (range 1 n)] (/ k (inc n)))
         norm-quants (quantile-normal quants)
	 theme (or (:theme opts) :default)
         y (quantile _x :probs quants)]
         (set-theme (scatter-plot norm-quants y
				  :title "QQ-Plot"
				  :x-label "Normal theoretical quantiles"
				  :y-label "Data quantiles"
				  :series-label "Theoretical Normal")
		    theme))))
Vars in incanter.charts/qq-plot: defn let
Used in 0 other vars

Comments top

No comments for qq-plot. Log in to add a comment.