Note that there are some explanatory texts on larger screens.

plurals
  1. POConditionally grouped histograms from my dataset
    primarykey
    data
    text
    <p>My current dataset <code>data.df</code> comes from about 420 students who took an 8-question survey under one of 3 instructors. <code>escore</code> is my outcome variable of interest. </p></p> <pre><code> 'data.frame': 426 obs. of 10 variables: $ ques01: int 1 1 1 1 1 1 0 0 0 1 ... $ ques02: int 0 0 1 1 1 1 1 1 1 1 ... $ ques03: int 0 0 1 1 0 0 1 1 0 1 ... $ ques04: int 1 0 1 1 1 1 1 1 1 1 ... $ ques05: int 0 0 0 0 1 0 0 0 0 0 ... $ ques06: int 1 0 1 1 0 1 1 1 1 1 ... $ ques07: int 0 0 1 1 0 1 1 0 0 1 ... $ ques08: int 0 0 1 1 1 0 1 1 0 1 ... $ inst : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ... $ escore: int 3 1 5 5 3 3 4 4 2 5 ... </code></pre> <p> I'm wondering how I can generate <code>escore</code> histograms that are conditionally separated based upon the value of <code>inst</code> for a given observation. In my head, the pseudo-code might look like this:</p> <p> <pre><code> par(mfrow=c(1,3)) hist(escore, data.df$inst = 1) hist(escore, data.df$inst = 2) hist(escore, data.df$inst = 3) </code></pre> </p> <p>but of course that won't work :-(</p> <p>Ideally, my histograms would look like this:</p> <p><a href="http://terpconnect.umd.edu/~briandk/escoreHistogramsbyInstructor-1.png" rel="nofollow noreferrer">3 separate histograms of ~140 observations each, grouped according to their &quot;inst&quot; value http://terpconnect.umd.edu/~briandk/escoreHistogramsbyInstructor-1.png</a></p> <p>As usual, I sense there's got to be an easy way to do this. In whatever "conditional/grouping" sense I can extract these graphs from my data, I assume it's <strong>got</strong> to be generalizable for all sorts of plots you'd want to make based on certain conditions.</p> <p>Also, I'm really sorry if this question has been answered before. My primary difficulty is in figuring out how to ask it in a way that makes sense.</p> <p>Thanks in advance for your help!</p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload