openintro-gorilla-incanter icon indicating copy to clipboard operation
openintro-gorilla-incanter copied to clipboard

Like R multiLines chart in Multiple regression lab

Open drewnoff opened this issue 9 years ago • 1 comments

given model m-bty-gen-ch and evals dataset, the solution looks like

(def m-bty-gen-ch
  (c/scatter-plot (i/$ :bty_avg evals) (i/$ :score evals)
                  :group-by (i/$ :gender evals)
                  :legend true))

(def coefs (m-bty-gen :coefs))

(c/add-function m-bty-gen-ch
  (fn [x] (first (i/mmult (i/trans [1 x 1]) coefs)))
                (apply min (i/$ :bty_avg evals))
                (apply max (i/$ :bty_avg evals)))

(c/add-function m-bty-gen-ch
  (fn [x] (first (i/mmult (i/trans [1 x 0]) coefs)))
                (apply min (i/$ :bty_avg evals))
                (apply max (i/$ :bty_avg evals)))

(chart-view m-bty-gen-ch)

drewnoff avatar Jan 20 '16 07:01 drewnoff

Excuse me. I am relatively new to R. Would you please let me know the package name to use "multiLines" function? I keep getting an error message, "could not find function multiLines"...

Jukang avatar Aug 25 '20 05:08 Jukang