PageSourceSearch

https://inzight.nz/assets/js/6fa9f846.f71c7de1.js

js inzight.nz collected 2026-10-03 23:43:58 UTC 12,949 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkinzight_website=globalThis.webpackChunkinzight_website||[]).push([[8145],{2878(e,t,a){a.r(t),a.d(t,{assets:()=>m,contentTitle:()=>u,default:()=>x,frontMatter:()=>p,metadata:()=>n,toc:()=>g});const n=JSON.parse('{"id":"getting-started/single-variable/index","title":"Working with one variable","description":"Graphs and summaries for single variables - the \\"Variable 1\\" box","source":"@site/docs/02-getting-started/03-single-variable/index.mdx","sourceDirName":"02-getting-started/03-single-variable","slug":"/getting-started/single-variable/","permalink":"/docs/getting-started/single-variable/","draft":false,"unlisted":false,"editUrl":"https://github.com/iNZightVIT/inzight-website/edit/main/docs/02-getting-started/03-single-variable/index.mdx","tags":[],"version":"current","lastUpdatedAt":1770344991000,"frontMatter":{"title":"Working with one variable","description":"Graphs and summaries for single variables - the \\"Variable 1\\" box"},"sidebar":"docs","previous":{"title":"First graphs","permalink":"/docs/getting-started/first-graphs/"},"next":{"title":"Working with two variables","permalink":"/docs/getting-started/two-variables/"}}');var s=a(4848),i=a(8453),o=a(7060);const r=a.p+"assets/images/inzight_cas_armspan-20ae2bacd73d75267ef4cce8f9f3bd08.png",l=a.p+"assets/images/inzight_cas_summary_armspan-37738c7c70a7acc8d5e8e7be00728ea6.png",h=a.p+"assets/images/inzight_cas_armspan_violin-ef30583168232a296ce3e5bc2a77c937.png",c=a.p+"assets/images/inzight_cas_travel-e684874fa654f1f30f69afdfb5a83de5.png",d=a.p+"assets/images/inzight_cas_summary_travel-6806c3868ea714fc73e550cb67b2bafc.png",p={title:"Working with one variable",description:'Graphs and summaries for single variables - the "Variable 1" box'},u=void 0,m={},g=[{value:"Numeric variables",id:"numeric-variables",level:2},{value:"Advanced: More than just dot plots",id:"other-numeric-plots",level:3},{value:"Categorical variables",id:"categorical-variables",level:2},{value:"Advanced: More than just bar charts",id:"other-categorical-plots",level:3}];function b(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",section:"section",strong:"strong",sup:"sup",ul:"ul",...(0,i.R)(),...e.components},{Figure:a,Version:n}=t;return a||f("Figure",!0),n||f("Version",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["As we saw in the previous section, it is easy to create a graph with iNZight. Simply ",(0,s.jsxs)(o.X8,{children:[(0,s.jsx)(t.strong,{children:"drag and drop"})," variables from the spreadsheet view to the variable boxes, or choose them directly"]}),(0,s.jsx)(o.bh,{children:"choose a variable"})," from the variable box drop-downs---iNZight will automatically create a graph for you!"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Numeric variables"})," produce a ",(0,s.jsx)(t.strong,{children:"dot plot"})," (by default)"]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.strong,{children:"Categorical variables"})," (or ",(0,s.jsx)(t.strong,{children:"factors"}),") produce a ",(0,s.jsx)(t.strong,{children:"bar plot"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:"In this section, we will learn how to obtain textual summaries of the information displayed in the plot, as well as learn about other ways of visualising single variables with iNZight."}),"\n",(0,s.jsx)(t.admonition,{title:"Be sure to load the data first",type:"info",children:(0,s.jsxs)(t.p,{children:["If you skipped the previous section, you can catch up by loading the ",(0,s.jsx)(t.strong,{children:"Census at School 500"})," dataset from ",(0,s.jsxs)(o.X8,{children:[(0,s.jsx)(t.strong,{children:"File"})," > ",(0,s.jsx)(t.strong,{children:"Example datasets"})]}),(0,s.jsxs)(o.bh,{children:[(0,s.jsx)(t.strong,{children:"File"})," > ",(0,s.jsx)(t.strong,{children:"Dataset examples"})]}),"."]})}),"\n",(0,s.jsx)(t.h2,{id:"numeric-variables",children:"Numeric variables"}),"\n",(0,s.jsxs)(t.p,{children:["Numeric variables are those that are ",(0,s.jsx)(t.strong,{children:"measured"})," or ",(0,s.jsx)(t.strong,{children:"counted"})," and represented using whole (1, 2, -25, 2021) or decimal (12.5, 10.35) numbers, for example ",(0,s.jsx)(t.em,{children:"height"}),", ",(0,s.jsx)(t.em,{children:"age"}),", or the amount of money spent on a mobile bill per month."]}),"\n",(0,s.jsxs)(t.p,{children:["To look at the distribution of students' armspans, choose ",(0,s.jsx)(t.code,{children:"armspan"})," as the first variable. You should see a ",(0,s.jsx)(t.em,{children:"dot plot"})," of the 500 students' armspans appear."]}),"\n","\n",(0,s.jsx)(a,{src:r,caption:"A dot plot of armspan",width:"800"}),"\n",(0,s.jsxs)(t.p,{children:["Immediately we can see that most students have armspans between 130 and 180 cm. However, there are many students who have measured their armspans to be as small as 20cm! Below the dotplot is a ",(0,s.jsx)(t.strong,{children:"box and whisker plot"}),", showing the range (the thin horizontal line), as well as the 25%, 50%, and 75% quantiles (the lower, middle, and upper ends of the box, respectively)."]}),"\n",(0,s.jsxs)(t.p,{children:["You can obtain a numeric summary of a graph by clicking the ",(0,s.jsxs)(o.X8,{children:[(0,s.jsx)(t.strong,{children:"Get Summary"})," button at the bottom of the iNZight window"]}),(0,s.jsxs)(o.bh,{children:[(0,s.jsx)(t.strong,{children:"Summary"})," button above the plot"]}),"."]}),"\n","\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(a,{src:l,caption:"Numeric summary of armspan",width:"800"}),";"]}),"\n",(0,s.jsxs)(t.p,{children:["This tells us the range of values (minimum and maximum values), the quantiles, as well as the sample mean and standard deviation. In addition to this at the top of the summary output, we see information about the variable: it is telling us that our ",(0,s.jsx)(t.strong,{children:"Primary variable of interest"})," (armspan) is a numeric variable, and that of the 500 students in the dataset, 36 are missing observations of armspan. This missing value information is also available at the bottom of the plot."]}),"\n",(0,s.jsx)(t.p,{children:"Have a look at some other numeric variables in the dataset (height, rightfoot, age, year, cellcost). Look at the graph and think about what it means: can you see anything interesting? Look at the summary information for each variable to get familiar with the information provided."}),"\n",(0,s.jsx)(t.h3,{id:"other-numeric-plots",children:"Advanced: More than just dot plots"}),"\n",(0,s.jsx)(t.p,{children:"Dot plots are OK, but you may have noticed that some variables provide odd-looking plots due to the way the points fall. iNZight provides a selection of alternative plot types for you to look at numeric variables!"}),"\n",(0,s.jsxs)(t.p,{children:["To do this, click on ",(0,s.jsxs)(o.X8,{children:[(0,s.jsx)(t.strong,{children:"Add to plot"})," in the plot toolbar, or find it in the ",(0,s.jsx)(t.strong,{children:"Plot"})," menu"]}),(0,s.jsxs)(o.bh,{children:[(0,s.jsx)(t.strong,{children:"Add to Plot"})," in the top-left of the screen"]}),". You'll see a panel appear with a lot of new controls in it. Don't worry about most of these for now---we will c
1over them later! For now, just focus on the ",(0,s.jsx)(t.strong,{children:"Plot type"}),' control at the top. Choose different plot types in this drop down and look at the resulting plot. In this example below, I\'ve chosen the "Violin" plot.']}),"\n","\n",(0,s.jsx)(a,{src:h,caption:"A violin plot of armspan",width:"800"}),"\n",(0,s.jsxs)(t.admonition,{title:"Feeling adventurous?",type:"tip",children:[(0,s.jsx)(t.p,{children:"Feel free to play with the other controls in this window and see what happens!"}),(0,s.jsxs)(t.p,{children:["If you get lost or confused, you can reset the plot by clicking ",(0,s.jsxs)(o.X8,{children:[(0,s.jsx)(t.strong,{children:"Remove additions"})," in the plot toolbar, or find it in the ",(0,s.jsx)(t.strong,{children:"Plot"})," menu and clicking ",(0,s.jsx)(t.strong,{children:"Remove all"})," at the bottom of the panel"]}),(0,s.jsxs)(o.bh,{children:[(0,s.jsx)(t.strong,{children:"Restore defaults"})," at the bottom of the ",(0,s.jsx)(t.strong,{children:"Select Variables"})," panel"]}),"."]})]}),"\n",(0,s.jsx)(t.h2,{id:"categorical-variables",children:"Categorical variables"}),"\n",(0,s.jsxs)(t.p,{children:["Categorical variables are those that have values which fall into ",(0,s.jsx)(t.strong,{children:"categories"})," (or ",(0,s.jsx)(t.strong,{children:"levels"}),"). For example, the way students travel to school might be by ",(0,s.jsx)(t.em,{children:"bus"}),", ",(0,s.jsx)(t.em,{children:"car"}),", or ",(0,s.jsx)(t.em,{children:"walk"}),'. A person\'s ethnicity is another example of categorical variable, as is a student\'s grade in an exam ("A", "B", "C", or "Excellence", "Merit", etc).']}),"\n",(0,s.jsxs)(t.p,{children:["Graphs of categorical variables involve displaying how many observations fall into each category, which is by default shown using a ",(0,s.jsx)(t.strong,{children:"bar chart"})," in iNZight. Let's look at a graph of ",(0,s.jsx)(t.code,{children:"travel"}),":"]}),"\n","\n",(0,s.jsx)(a,{src:c,caption:"A bar plot of travel",width:"800"}),"\n",(0,s.jsx)(t.p,{children:"Immediately we can see that most students travel via motor (typically a car), and equal numbers either catch a bus or walk. Only a few students catch a train."}),"\n",(0,s.jsxs)(t.p,{children:["As before, we can get a numeric summary of the graph by clicking ",(0,s.jsx)(t.strong,{children:(0,s.jsx)(n,{desktop:"Get Summary",lite:"Summary"})}),"."]}),"\n","\n",(0,s.jsx)(a,{src:d,caption:"Numeric summary of travel",width:"800"}),"\n",(0,s.jsx)(t.p,{children:"Here we can see both the actual counts in each category, as well as the percentage in each. On the far right we see the total of 500 students. Note that there are no missing observations in this variable!"}),"\n",(0,s.jsxs)(t.p,{children:["You can now look at all of the variables in the dataset. The categorical variables you can look at are ",(0,s.jsx)(t.em,{children:"getlunch"}),", ",(0,s.jsx)(t.em,{children:"gender"}),(0,s.jsx)(t.sup,{children:(0,s.jsx)(t.a,{href:"#user-content-fn-1",id:"user-content-fnref-1","data-footnote-ref":!0,"aria-describedby":"footnote-label",children:"1"})}),", and ",(0,s.jsx)(t.em,{children:"cellsource"}),". Take a look at these---can you find anything interesting?"]}),"\n",(0,s.jsx)(t.h3,{id:"other-categorical-plots",children:"Advanced: More than just bar charts"}),"\n",(0,s.jsxs)(t.p,{children:["As before, you can use the ",(0,s.jsx)(t.strong,{children:"Add to Plot"})," panel to explore different ways of looking at categorical variables. Try looking through some of these. Can you see any patterns in some that aren't quite so obvious in others?"]}),"\n",(0,s.jsx)(t.p,{children:"That completes single variable plots with iNZight. We are now ready to move on to looking at two variables at once!"}),"\n","\n",(0,s.jsxs)(t.section,{"data-footnotes":!0,className:"footnotes",children:[(0,s.jsx)(t.h2,{className:"sr-only",id:"footnote-label",children:"Footnotes"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{id:"user-content-fn-1",children:["\n",(0,s.jsxs)(t.p,{children:["In the Census at School dataset bundled with iNZight, ",(0,s.jsx)(t.em,{children:"gender"})," is treated as a ",(0,s.jsx)(t.strong,{children:"binary"})," variable (two levels). More recent versions of the survey have added 'Non-binary' as a choice (yay!), and in future we will replace the dataset bundled with iNZight with a more up-to-date one! ",(0,s.jsx)(t.a,{href:"#user-content-fnref-1","data-footnote-backref":"","aria-label":"Back to reference 1",className:"data-footnote-backref",children:"\u21a9"})]}),"\n"]}),"\n"]}),"\n"]})]})}function x(e={}){const{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(b,{...e})}):b(e)}function f(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},7060(e,t,a){a.d(t,{Rx:()=>r,X8:()=>i,bh:()=>o});a(6540);var n=a(9285),s=a(4848);function i({children:e}){const{version:t}=(0,n.M)();return(0,s.jsx)("div",{style:"desktop"===t?void 0:{display:"none"},children:e})}function o({children:e}){const{version:t}=(0,n.M)();return(0,s.jsx)("div",{style:"lite"===t?void 0:{display:"none"},children:e})}function r({desktop:e,lite:t}){const{version:a}=(0,n.M)();return"lite"===a?t:e}},8453(e,t,a){a.d(t,{R:()=>o,x:()=>r});var n=a(6540);const s={},i=n.createContext(s);function o(e){const t=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),n.createElement(i.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.