LAISHA
Open Laisha

ICAR-IASRI MSc and PhD Programming for Statistics & Data (R and Python): practice questions

ICAR-IASRI MSc and PhD (Agricultural Statistics, Computer Application, Bioinformatics) · India · ICAR-Indian Agricultural Statistics Research Institute with the IARI Graduate School

Original practice questions written to the published syllabus · not past papers
10worked here, free
31written to this exam in this subject
8syllabus units

About ICAR-IASRI MSc and PhD

ICAR-IASRI MSc and PhD (Agricultural Statistics, Computer Application, Bioinformatics) is a postgraduate admission exam run by ICAR-Indian Agricultural Statistics Research Institute with the IARI Graduate School, for candidates in India. Admission through ICAR AIEEA-PG (Master's) and AICE-JRF/SRF (PhD) plus the Graduate School's own process.

Official site: iasri.icar.gov.in.

We have not been able to confirm these details against the exam body's own specification, so fees, dates and pass marks are left out on purpose. Check the current format, eligibility, fees and dates on the official site.

Programming for Statistics & Data (R and Python) in ICAR-IASRI MSc and PhD

Writing correct, readable programs for data work: R and Python as the working languages, with the control structures, functions, data frames, vectorisation and debugging habits that later computing subjects assume. C and SAS are covered where agricultural universities still teach them.

Our 31 ICAR-IASRI MSc and PhD questions in this subject: 13 easy, 18 medium, 0 hard, across 8 units.

10 practice questions, worked

Choose an answer, then open the working. Each explanation says why the right answer is right and why the others are not.

These 10 were written to ICAR-IASRI MSc and PhD and are not shown on any other exam's page.

Question 1 · medium

For a list lst in R, lst[1] and lst[[1]] return respectively:

  1. The element itself, and then a list containing it
  2. The same object in both cases
  3. A list of length one, and the element itself
  4. An error, and the element
Answer and working

C. A list of length one, and the element itself

Single brackets subset the list; double brackets extract the element.

Question 2 · medium

Why is seq_along(x) preferred to 1:length(x) in R loops?

  1. seq_along(x) is always much faster in every case
  2. 1:length(x) is not valid syntax
  3. seq_along(x) skips missing values
  4. 1:length(x) gives c(1, 0) when x is empty
Answer and working

D. 1:length(x) gives c(1, 0) when x is empty

With an empty x, 1:0 runs the loop twice with invalid indices; seq_along gives an empty sequence.

Question 3 · medium

R's lexical scoping means that a function looks up a free variable:

  1. In the environment where it is called
  2. Only among its arguments
  3. Where the function was defined
  4. Only in the global environment
Answer and working

C. Where the function was defined

Lookup follows the defining environment, then its parents.

Question 4 · medium

Which join keeps only rows whose keys appear in both tables?

  1. Left join
  2. Full join
  3. Right join
  4. Inner join
Answer and working

D. Inner join

Left and right joins keep all rows of one table; full keeps all of both.

Question 5 · easy

Which ggplot2 function splits a plot into panels by a variable?

  1. facet_wrap
  2. geom_smooth
  3. scale_colour
  4. coord_flip
Answer and working

A. facet_wrap

Facets create small multiples.

Question 6 · medium

The grammar of graphics that ggplot2 implements was set out by:

  1. Tukey
  2. Fisher
  3. Knuth
  4. Wilkinson
Answer and working

D. Wilkinson

Leland Wilkinson's The Grammar of Graphics.

Question 7 · medium

A scatter-plot matrix of several variables in base R is drawn with:

  1. histogram()
  2. barplot()
  3. boxplot()
  4. pairs()
Answer and working

D. pairs()

pairs plots every pair of variables.

Question 8 · medium

Declaring package dependencies and versions for a project mainly prevents:

  1. Viruses and malware on the shared computer
  2. Data entry errors
  3. Breakage when shared libraries change
  4. Slow plotting
Answer and working

C. Breakage when shared libraries change

Pinned versions and project environments keep analyses reproducible.

Question 9 · easy

A well-designed function should:

  1. Print every intermediate value
  2. Use as many global variables as possible
  3. Be as long as possible
  4. Return values, not change globals
Answer and working

D. Return values, not change globals

Pure, focused functions are easier to test and reuse.

Question 10 · medium

Which is a testing framework for R?

  1. ggplot2
  2. testthat
  3. tidyr
  4. Rcpp
Answer and working

B. testthat

pytest is the common Python framework.

A study plan for Programming for Statistics & Data (R and Python) in ICAR-IASRI MSc and PhD

This plan follows where our questions actually fall, so the time goes where the marks are likely to be. It is our reading of the syllabus, not the exam body's weighting.

  1. First, the heavy units (55% of the 31 questions): R: vectors, data frames, factors and lists (7, 23%); R: functions, control flow and vectorisation (6, 19%); Graphics in R (base and ggplot2) and Python (matplotlib) (4, 13%).

    Read the manual chapters for these first and do every worked question you can find on them.

  2. Then the middle band: Writing functions and simple packages (4, 13%); Algorithms, flowcharts and pseudocode (3, 10%); Debugging, testing and code style (3, 10%).

    Aim for one sitting per unit, then mixed questions across them.

  3. Then the lighter units: Reading, cleaning and reshaping data (3, 10%); Python: core types, NumPy arrays and pandas data frames (1, 3%).

    Learn the definitions, classifications and standard numbers; these units are more often recalled than worked.

  4. Bank the easy marks: Writing functions and simple packages (3 easy of 4); Algorithms, flowcharts and pseudocode (2 easy of 3).

    Do these early in revision so they are fast on the day.

  5. Finish timed. Sit the subject as a timed set without notes, mark it, and send each wrong answer back to its unit above.

Last updated · How Laisha writes and checks its pages · Report a mistake

Ask Laisha about this

Opens Laisha's chat with your question ready to send. Sign in or start free.

Unlock every question — ICAR-IASRI MSc and PhD Programming for Statistics & Data (R and Python)

US$10 a month · one price worldwide · cancel any time

  • Every practice question in this subject, with full working
  • Timed exam papers and progress by unit
  • Ask Laisha to explain any answer — up to 1,000 questions a month
Free or Smarter
FreeSmarter
Grow guides, pest pages, articlesRead allRead all
Ask Laisha5 a dayUp to 1,000 a month
Exam practiceThe sample on each pageEvery question, timed papers
Crop calendar and pest alerts—For your own fields
Calculators and tools—All
Uploads and reports—100 a month, real files
10 days free for every new account, no card.