[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-571683-105":53,"doc-detail-571683-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","r-commands-quick-reference-sheet-1-chapter-1-9","R Commands - Quick Reference Sheet 1 - Chapter 1-9","","Quick Reference Sheet 1 consolidates core R commands for descriptive statistics, data handling, and inference across nine structured chapters. It covers loading and managing datasets, variable extraction, subsetting, random sampling, and labeling axes or plot titles. Subsequent chapters summarize frequency and contingency tables, quantitative summaries, scatterplots, and correlation, then extend to simulation. Later sections introduce bootstrap and sampling distributions, randomization tests with p-value estimation, and distribution-based inference for normal, t, chi-square, and F. The guide closes with analysis of variance and linear regression functions plus associated prediction and correlation tests.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/r-commands-quick-reference-sheet-1-chapter-1-9/571683/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/r-commands-quick-reference-sheet-1-chapter-1-9/571683.png","ImageObject",442,249,{"name":88,"@type":89},"Malam Tenang","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-21","2026-10-13",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",6,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What R commands are provided for loading and inspecting data?","Question",{"text":109,"@type":110},"The sheet lists commands to load datasets and access variables, including google.doc(\"key\") usage, variable extraction via dataname$variablename, and attach/detach(dataname) for dataset management.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"How does the guide produce and use bootstrap distributions?",{"text":114,"@type":110},"It uses do(1000)*mean(sample(...)) and replace=TRUE for generating bootstrap sampling distributions, then summarizes them with hist(boot .dist), sd(boot .dist), and percentile(boot .dist, c(0.025, 0.975)), including a bootstrap confidence interval via bootstrap.interval.",{"name":116,"@type":107,"acceptedAnswer":117},"Which functions are included for inference with standard distributions and for regression?",{"text":118,"@type":110},"For distribution inference it includes percentile and tail.p for normal and t, prop.test and t.test for proportions and means, and chisq.test and tail.p for chi-square plus anova via summary(aov(y ~ x)). For regression it provides plot(y ~ x), lm(y ~ x), summary(model), abline(model), cor.test, and predict(...) for predictions.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},571683,1792023029,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":79,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":73},962093532863,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","R Commands: Quick Reference Sheet 1  \nto accompany Statistics: Unlocking the Power of Data by Lock5  \nCHAPTER 1  \n\n| Loading Data\u003Cbr>Load a dataset from a google doc2 Load a dataset from the textbook Help for textbook datasets Type in a variable | google.doc(\"key\")\\#key: between key= and \\# in url data(dataname)\u003Cbr>?dataname\u003Cbr>variablename = c(3 .2, 3 .3, 3.1) |\n| --- | --- |\n| Variables\u003Cbr>Extract a variable from a dataset Attach a dataset\u003Cbr>Detach a dataset | dataname$variablename\u003Cbr>attach(dataname)\u003Cbr>detach(dataname) |\n| Subsetting Data\u003Cbr>Take a subset of a dataset | subset(dataname , condition) |\n| Random Sample\u003Cbr>Taking a random sample of size nn random integers 1 to max | sample(dataname , n) \\#use for data or variable sample(1:max, n) |\n\nCHAPTER 2  \n\n| One Categorical (x)\u003Cbr>Frequency table Proportion in group A Pie chart\u003Cbr>Bar chart | table(x)\u003Cbr>mean(x == \"A\")\u003Cbr>pie(table(x))\u003Cbr>barplot(table(x)) |\n| --- | --- |\n| Two Categorical (x1, x2)\u003Cbr>Two-way table Proportions by group Difference in proportions Segmented bar chart Side-by-side bar chart | table(x1 , x2) mean(x1==\"A\"~x2) diffProp(x1==\"A\"~x2)\u003Cbr>barplot(table(x1 , x2) , legend=TRUE)\u003Cbr>barplot(table(x1 ,x2),legend=TRUE,beside=TRUE) |\n| One Quantitative (y) |  |\n| Mean | mean(y) |\n| Median | median(y) |\n| Standard deviation | sd(y) |\n| 5-Number summary\u003Cbr>Percentile | summary(y)\u003Cbr>percentile(y , 0.05) |\n| Histogram Boxplot | hist(y)\u003Cbr>boxplot(y) |\n| One Quant. (y) and One Cat. (x)\u003Cbr>Means by group Difference in means Standard deviation by group Side-by-side boxplots | mean(y ~ x)\u003Cbr>diffMean(y ~ x)\u003Cbr>sd(y ~ x)\u003Cbr>boxplot(y ~ x) |\n\n1 First time only, run source(\"/shared/kari .lock .morgan@gmail .com/Lock5 .R\")  \n2  \nFor your own google spreadsheet, within the google spreadsheet you first have to do File -­‐> Publish to Web -­‐> Start Publishing.  \n\n| Two Quantitative (y1, y2)\u003Cbr>Scatterplot\u003Cbr>Correlation | plot(y1 , y2)\u003Cbr>cor(y1 , y2) |\n| --- | --- |\n| Labels\u003Cbr>Add a title Label an axis | \\#optional arguments for any plot: main = \"title of plot\"\u003Cbr>xlab = \"x-axis label\", ylab = \"y-axis label\" |\n\nCHAPTER 3  \n\n| Repeat Code 1000 Times | do(1000)* |\n| --- | --- |\n| Sampling Distribution for Mean | do(1000)*mean(sample(y , n)) |\n| Bootstrap Distribution for Mean | do(1000)*mean(sample(y , n , replace=TRUE)) |\n| Generating a Sampling Distribution for any Statistic | do(1000)*{\u003Cbr>samp = sample([pop.](pop.data)[data](pop.data), n)\u003Cbr>statistic (samp$var1, samp$var2)\u003Cbr>} |\n| Manually Generating a Bootstrap Distribution for any Statistic | do(1000)*{\u003Cbr>boot .samp = sample(data , n , replace=TRUE)\u003Cbr>statistic (boot .samp$var1, boot .samp$var2)} |\n| Using a\u003Cbr>Bootstrap Distribution | hist(boot .dist)\u003Cbr>sd(boot .dist)\u003Cbr>percentile (boot .dist , c( 0.025 , 0.975)) |\n| Generate a Bootstrap CI | bootstrap .interval (var1 , var2) \\#level = .95 |\n\nCHAPTER 4  \n\n| Randomization Statistic:\u003Cbr>Shuffle one variable (x) Proportion\u003Cbr>Mean | shuffle(x)\u003Cbr>coin .flips(n , p)\u003Cbr>mean(sample(y + shift , n , replace=TRUE)) |\n| --- | --- |\n| Randomization Distribution | do(1000)*one randomization statistic |\n| Finding p-value from a randomization distribution:\u003Cbr>Lower-tailed test Upper-tailed test Two-tailed test | \\#rand .dist = randomization distribution\u003Cbr>\\#obs .stat = observed sample statistic\u003Cbr>tail .p(rand .dist , obs .stat , tail=\"lower\")\u003Cbr>tail .p(rand .dist , obs .stat , tail=\"upper\")\u003Cbr>tail .p(rand .dist , obs .stat , tail=\"two\") |\n| Randomization Test via Reallocating | randomization .test (y , x) \\#null = for one var \\#tail=\"lower\", \"upper\", \"two\" |\n\nCHAPTER 5  \n\n| Normal Distribution:\u003Cbr>Find a percentile for N(0,1)\u003Cbr>Find the area beyond z on N(0,1) Find percentiles or area for any normal | \\#tail=\"lower\", tail=\"upper\", tail=\"two\"\u003Cbr>percentile(\"normal\", 0.10)\u003Cbr>tail .p(\"normal\", z, tail=\"lower\")\u003Cbr>\\#add the optional arguments mean=, sd= |\n| --- | --- |\n\nCHAPTER 6  \n\n| Normal Distribution:\u003Cbr>Find a percentile for N(0,1) Find the area beyond z on N(0","cbCaioH9KKeat59X","https://ap.wps.com/l/cbCaioH9KKeat59X","pdf",144455,"English","# Chapter 1\n## Loading Data\n## Variables\n## Subsetting Data\n## Random Sample\n# Chapter 2\n## One Categorical (x)\n## Two Categorical (x1, x2)\n## One Quantitative (y)\n## One Quant. (y) and One Cat. (x)\n# Chapter 3\n## Repeat Code 1000 Times\n## Sampling Distribution for Mean\n## Bootstrap Distribution for Mean\n## Generating Sampling/Bootstrap Distributions\n## Bootstrap CI\n# Chapter 4\n## Randomization Statistic\n## Randomization Distribution\n## Finding p-value from a randomization distribution\n## Randomization Test via Reallocating\n# Chapter 5\n## Normal Distribution\n# Chapter 6\n## Normal Distribution\n## t-Distribution\n## Inference for Proportions\n## Inference for Means\n# Chapter 7\n## Chi-Square Distribution\n## Chi-Square Test\n## Randomization Test\n# Chapter 8\n## F Distribution\n## Analysis of Variance\n## Pairwise Comparisons\n# Chapter 9\n## Simple Linear Regression\n## Inference for Correlation\n## Prediction","[{\"question\":\"What R commands are provided for loading and inspecting data?\",\"answer\":\"The sheet lists commands to load datasets and access variables, including google.doc(\\\"key\\\") usage, variable extraction via dataname$variablename, and attach/detach(dataname) for dataset management.\"},{\"question\":\"How does the guide produce and use bootstrap distributions?\",\"answer\":\"It uses do(1000)*mean(sample(...)) and replace=TRUE for generating bootstrap sampling distributions, then summarizes them with hist(boot .dist), sd(boot .dist), and percentile(boot .dist, c(0.025, 0.975)), including a bootstrap confidence interval via bootstrap.interval.\"},{\"question\":\"Which functions are included for inference with standard distributions and for regression?\",\"answer\":\"For distribution inference it includes percentile and tail.p for normal and t, prop.test and t.test for proportions and means, and chisq.test and tail.p for chi-square plus anova via summary(aov(y ~ x)). For regression it provides plot(y ~ x), lm(y ~ x), summary(model), abline(model), cor.test, and predict(...) for predictions.\"}]","R Commands - Quick Reference Sheet 1 - Chapter 1-9 | PDF",1791923102]