Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 394309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:20:35+00:00 2026-05-12T16:20:35+00:00

My current dataset data.df comes from about 420 students who took an 8-question survey

  • 0

My current dataset data.df comes from about 420 students who took an 8-question survey under one of 3 instructors. escore is my outcome variable of interest.


    '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 ...
     

I’m wondering how I can generate escore histograms that are conditionally separated based upon the value of inst for a given observation. In my head, the pseudo-code might look like this:


    par(mfrow=c(1,3)) 
    hist(escore, data.df$inst = 1)
    hist(escore, data.df$inst = 2)
    hist(escore, data.df$inst = 3)

but of course that won’t work 🙁

Ideally, my histograms would look like this:

3 separate histograms of ~140 observations each, grouped according to their "inst" value http://terpconnect.umd.edu/~briandk/escoreHistogramsbyInstructor-1.png

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 got to be generalizable for all sorts of plots you’d want to make based on certain conditions.

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.

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:20:36+00:00Added an answer on May 12, 2026 at 4:20 pm

    Use the lattice package:

    library(lattice)
    histogram( ~ escore | inst, data=X)
    

    if X is your data.frame object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble accessing a dataset. I've pulled data from an Access database (successfully
For my current project in c# I need to transfer data from a SQL-Database
I am using a dataset to insert data being converted from an older database.
Current situation: Ubuntu 8.04 server edition (live server) Postgresql 8.3.7 (from standard repositories) Postgis
Current Version of the Question: I initialize an array $tbd_list as follows: $tbd_list =
I am retrieving data from a SQL table so I can display the result
I need to read from a dataset which is very large, highly interlinked, the
The code below is from SAMATE Reference Dataset . I used it to test
The essence of the situation comes down to the following: I have a data
In one of my current side projects, I am scanning through some text looking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.