render compile
This commit is contained in:
BIN
SD/9_课后作业8/.RData
Normal file
BIN
SD/9_课后作业8/.RData
Normal file
Binary file not shown.
1
SD/9_课后作业8/_extensions
Symbolic link
1
SD/9_课后作业8/_extensions
Symbolic link
@@ -0,0 +1 @@
|
||||
../../_extensions
|
||||
BIN
SD/9_课后作业8/airqualitydf.RDS
Normal file
BIN
SD/9_课后作业8/airqualitydf.RDS
Normal file
Binary file not shown.
BIN
SD/9_课后作业8/airqualitymedianoutrow5.pdf
Normal file
BIN
SD/9_课后作业8/airqualitymedianoutrow5.pdf
Normal file
Binary file not shown.
BIN
SD/9_课后作业8/freq.pdf
Normal file
BIN
SD/9_课后作业8/freq.pdf
Normal file
Binary file not shown.
638
SD/9_课后作业8/index.html
Normal file
638
SD/9_课后作业8/index.html
Normal file
@@ -0,0 +1,638 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hans"><head>
|
||||
<script src="../../site_libs/clipboard/clipboard.min.js"></script>
|
||||
<script src="../../site_libs/quarto-html/tabby.min.js"></script>
|
||||
<script src="../../site_libs/quarto-html/popper.min.js"></script>
|
||||
<script src="../../site_libs/quarto-html/tippy.umd.min.js"></script>
|
||||
<link href="../../site_libs/quarto-html/tippy.css" rel="stylesheet">
|
||||
<link href="../../site_libs/quarto-html/light-border.css" rel="stylesheet">
|
||||
<link href="../../site_libs/quarto-html/quarto-syntax-highlighting-dark-31d8df3fb4b3ebd213a509f950828e75.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
|
||||
<meta name="generator" content="quarto-1.7.1">
|
||||
|
||||
<meta name="author" content="苏命、王为东 中国科学院大学资源与环境学院 中国科学院生态环境研究中心">
|
||||
<meta name="dcterms.date" content="2025-03-17">
|
||||
<title>Version: {{< var branch >}} – 课后作业8</title>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
|
||||
<link rel="stylesheet" href="../../site_libs/revealjs/dist/reset.css">
|
||||
<link rel="stylesheet" href="../../site_libs/revealjs/dist/reveal.css">
|
||||
<style>
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
div.columns{display: flex; gap: min(4vw, 1.5em);}
|
||||
div.column{flex: auto; overflow-x: auto;}
|
||||
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||
ul.task-list{list-style: none;}
|
||||
ul.task-list li input[type="checkbox"] {
|
||||
width: 0.8em;
|
||||
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="../../site_libs/revealjs/dist/theme/quarto-5b48f34d633aed70c74c672477009ffc.css">
|
||||
<link rel="stylesheet" href="./_extensions/inst/css/revealjs.css">
|
||||
<link href="../../site_libs/revealjs/plugin/quarto-line-highlight/line-highlight.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/reveal-menu/menu.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/reveal-menu/quarto-menu.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/reveal-chalkboard/font-awesome/css/all.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/reveal-chalkboard/style.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/reveal-pointer/pointer.css" rel="stylesheet">
|
||||
<link href="../../site_libs/revealjs/plugin/quarto-support/footer.css" rel="stylesheet">
|
||||
<script type="application/json" class="js-hypothesis-config">
|
||||
{
|
||||
"theme": "clean",
|
||||
"openSidebar": false
|
||||
}
|
||||
</script>
|
||||
<script async="" src="https://hypothes.is/embed.js"></script>
|
||||
<script>
|
||||
window.document.addEventListener("DOMContentLoaded", function (_event) {
|
||||
document.body.classList.add('hypothesis-enabled');
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.reveal div.sourceCode {
|
||||
margin: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
.reveal div.hanging-indent {
|
||||
margin-left: 1em;
|
||||
text-indent: -1em;
|
||||
}
|
||||
.reveal .slide:not(.center) {
|
||||
height: 100%;
|
||||
}
|
||||
.reveal .slide.scrollable {
|
||||
overflow-y: auto;
|
||||
}
|
||||
.reveal .footnotes {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.reveal .slide .absolute {
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
.reveal .footnotes ol {
|
||||
counter-reset: ol;
|
||||
list-style-type: none;
|
||||
margin-left: 0;
|
||||
}
|
||||
.reveal .footnotes ol li:before {
|
||||
counter-increment: ol;
|
||||
content: counter(ol) ". ";
|
||||
}
|
||||
.reveal .footnotes ol li > p:first-child {
|
||||
display: inline-block;
|
||||
}
|
||||
.reveal .slide ul,
|
||||
.reveal .slide ol {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
.reveal .slide ul li,
|
||||
.reveal .slide ol li {
|
||||
margin-top: 0.4em;
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
.reveal .slide ul[role="tablist"] li {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.reveal .slide ul li > *:first-child,
|
||||
.reveal .slide ol li > *:first-child {
|
||||
margin-block-start: 0;
|
||||
}
|
||||
.reveal .slide ul li > *:last-child,
|
||||
.reveal .slide ol li > *:last-child {
|
||||
margin-block-end: 0;
|
||||
}
|
||||
.reveal .slide .columns:nth-child(3) {
|
||||
margin-block-start: 0.8em;
|
||||
}
|
||||
.reveal blockquote {
|
||||
box-shadow: none;
|
||||
}
|
||||
.reveal .tippy-content>* {
|
||||
margin-top: 0.2em;
|
||||
margin-bottom: 0.7em;
|
||||
}
|
||||
.reveal .tippy-content>*:last-child {
|
||||
margin-bottom: 0.2em;
|
||||
}
|
||||
.reveal .slide > img.stretch.quarto-figure-center,
|
||||
.reveal .slide > img.r-stretch.quarto-figure-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.reveal .slide > img.stretch.quarto-figure-left,
|
||||
.reveal .slide > img.r-stretch.quarto-figure-left {
|
||||
display: block;
|
||||
margin-left: 0;
|
||||
margin-right: auto;
|
||||
}
|
||||
.reveal .slide > img.stretch.quarto-figure-right,
|
||||
.reveal .slide > img.r-stretch.quarto-figure-right {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="quarto-dark">
|
||||
<div class="reveal">
|
||||
<div class="slides">
|
||||
|
||||
<section id="title-slide" class="quarto-title-block center">
|
||||
<h1 class="title">课后作业8</h1>
|
||||
<p class="subtitle">《区域水环境污染数据分析实践》<br>Data analysis practice of regional water environment pollution</p>
|
||||
|
||||
<div class="quarto-title-authors">
|
||||
<div class="quarto-title-author">
|
||||
<div class="quarto-title-author-name">
|
||||
苏命、王为东<br>中国科学院大学资源与环境学院<br>中国科学院生态环境研究中心
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="date">2025-03-17</p>
|
||||
</section>
|
||||
<section id="第8次课后作业" class="slide level2">
|
||||
<h2>第8次课后作业</h2>
|
||||
<ol type="1">
|
||||
<li>根据<code>airqualitydf.xlsx</code>,按采样点统计白天(8:00-20:00)与夜晚(20:00-8:00)中空气质量指数(AQI)中位数,按城市统计低于所有采样点AQI30%分位值的采样点占比,列出上述占比最高的10个城市(不考虑采样点数低于5个的城市)。</li>
|
||||
<li>按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。</li>
|
||||
</ol>
|
||||
<p>作业模板:<a href="https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/main/SD/20240328_9_课后作业/第8次课后作业_模板.qmd">第8次课后作业_模板.qmd</a></p>
|
||||
</section>
|
||||
<section id="示例代码" class="slide level2">
|
||||
<h2>示例代码</h2>
|
||||
<h3 id="基于r的示例结果">基于R的示例结果</h3>
|
||||
<ul>
|
||||
<li><a href="./第8次课后作业_模板.html">第8次课后作业R示例代码结果</a></li>
|
||||
</ul>
|
||||
<h3 id="基于sas的示例结果">基于SAS的示例结果</h3>
|
||||
<ul>
|
||||
<li><a href="./第8次课后作业_模板.sas">第8次课后作业SAS示例代码</a></li>
|
||||
<li><a href="./median.pdf">第8次课后作业SAS示例结果1</a></li>
|
||||
<li><a href="./freq.pdf">第8次课后作业SAS示例结果2</a></li>
|
||||
<li><a href="./airqualitymedianoutrow5.pdf">第8次课后作业SAS示例结果3</a></li>
|
||||
<li><a href="./npar1wayConover.pdf">第8次课后作业SAS示例结果4</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
<section id="欢迎讨论" class="slide level2 center">
|
||||
<h2>欢迎讨论!</h2>
|
||||
<span class="r-fit-text"><svg viewbox="0 0 576 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"></path> </svg><a href="https://drwater.rcees.ac.cn">苏命|https://drwater.rcees.ac.cn</a>; <svg viewbox="0 0 576 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M528 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm0 400H48V80h480v352zM208 256c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm-89.6 128h179.2c12.4 0 22.4-8.6 22.4-19.2v-19.2c0-31.8-30.1-57.6-67.2-57.6-10.8 0-18.7 8-44.8 8-26.9 0-33.4-8-44.8-8-37.1 0-67.2 25.8-67.2 57.6v19.2c0 10.6 10 19.2 22.4 19.2zM360 320h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8zm0-64h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8zm0-64h112c4.4 0 8-3.6 8-8v-16c0-4.4-3.6-8-8-8H360c-4.4 0-8 3.6-8 8v16c0 4.4 3.6 8 8 8z"></path> </svg><a href="https://drwater.rcees.ac.cn/bcard">https://drwater.rcees.ac.cn/bcard</a>; <svg viewbox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"></path> </svg><a href="https://drwater.rcees.ac.cn/course/public/RWEP/@PUB/SD/">Slides</a></span><br><br>
|
||||
<div class="columns">
|
||||
<div class="column" style="width:30%;">
|
||||
<span class="r-fit-text"><svg viewbox="0 0 512 512" style="height:1em;position:relative;display:inline-block;top:.1em;" xmlns="http://www.w3.org/2000/svg"> <path d="M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm0 48v40.805c-22.422 18.259-58.168 46.651-134.587 106.49-16.841 13.247-50.201 45.072-73.413 44.701-23.208.375-56.579-31.459-73.413-44.701C106.18 199.465 70.425 171.067 48 152.805V112h416zM48 400V214.398c22.914 18.251 55.409 43.862 104.938 82.646 21.857 17.205 60.134 55.186 103.062 54.955 42.717.231 80.509-37.199 103.053-54.947 49.528-38.783 82.032-64.401 104.947-82.653V400H48z"></path> </svg><a href="mailto:mingsu@rcees.ac.cn">mingsu@rcees.ac.cn</a>;</span><br>
|
||||
</div></div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<div class="quarto-auto-generated-content" style="display: none;">
|
||||
<p><img src="./_extensions/inst/img/ucaslogo.png" class="slide-logo"></p>
|
||||
<div class="footer footer-default">
|
||||
|
||||
</div>
|
||||
</div></div>
|
||||
|
||||
<script>window.backupDefine = window.define; window.define = undefined;</script>
|
||||
<script src="../../site_libs/revealjs/dist/reveal.js"></script>
|
||||
<!-- reveal.js plugins -->
|
||||
<script src="../../site_libs/revealjs/plugin/quarto-line-highlight/line-highlight.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/pdf-export/pdfexport.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/reveal-menu/menu.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/reveal-menu/quarto-menu.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/reveal-chalkboard/plugin.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/reveal-pointer/pointer.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/quarto-support/support.js"></script>
|
||||
|
||||
|
||||
<script src="../../site_libs/revealjs/plugin/notes/notes.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/search/search.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/zoom/zoom.js"></script>
|
||||
<script src="../../site_libs/revealjs/plugin/math/math.js"></script>
|
||||
<script>window.define = window.backupDefine; window.backupDefine = undefined;</script>
|
||||
|
||||
<script>
|
||||
|
||||
// Full list of configuration options available at:
|
||||
// https://revealjs.com/config/
|
||||
Reveal.initialize({
|
||||
'controlsAuto': true,
|
||||
'previewLinksAuto': true,
|
||||
'pdfSeparateFragments': false,
|
||||
'autoAnimateEasing': "ease",
|
||||
'autoAnimateDuration': 1,
|
||||
'autoAnimateUnmatched': true,
|
||||
'jumpToSlide': true,
|
||||
'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"<i class=\"fas fa-gear\"></i>","content":"<ul class=\"slide-menu-items\">\n<li class=\"slide-tool-item active\" data-item=\"0\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.fullscreen(event)\"><kbd>f</kbd> Fullscreen</a></li>\n<li class=\"slide-tool-item\" data-item=\"1\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.speakerMode(event)\"><kbd>s</kbd> Speaker View</a></li>\n<li class=\"slide-tool-item\" data-item=\"2\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.overview(event)\"><kbd>o</kbd> Slide Overview</a></li>\n<li class=\"slide-tool-item\" data-item=\"3\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.togglePdfExport(event)\"><kbd>e</kbd> PDF Export Mode</a></li>\n<li class=\"slide-tool-item\" data-item=\"4\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.toggleScrollView(event)\"><kbd>r</kbd> Scroll View Mode</a></li>\n<li class=\"slide-tool-item\" data-item=\"5\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.toggleChalkboard(event)\"><kbd>b</kbd> Toggle Chalkboard</a></li>\n<li class=\"slide-tool-item\" data-item=\"6\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.toggleNotesCanvas(event)\"><kbd>c</kbd> Toggle Notes Canvas</a></li>\n<li class=\"slide-tool-item\" data-item=\"7\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.downloadDrawings(event)\"><kbd>d</kbd> Download Drawings</a></li>\n<li class=\"slide-tool-item\" data-item=\"8\"><a href=\"#\" onclick=\"RevealMenuToolHandlers.keyboardHelp(event)\"><kbd>?</kbd> Keyboard Help</a></li>\n</ul>"}],"openButton":true},
|
||||
'chalkboard': {"buttons":true},
|
||||
'pointer': {"key":"p","color":"#32cd32","pointerSize":18,"alwaysVisible":false},
|
||||
'smaller': false,
|
||||
|
||||
// Display controls in the bottom right corner
|
||||
controls: false,
|
||||
|
||||
// Help the user learn the controls by providing hints, for example by
|
||||
// bouncing the down arrow when they first encounter a vertical slide
|
||||
controlsTutorial: false,
|
||||
|
||||
// Determines where controls appear, "edges" or "bottom-right"
|
||||
controlsLayout: 'edges',
|
||||
|
||||
// Visibility rule for backwards navigation arrows; "faded", "hidden"
|
||||
// or "visible"
|
||||
controlsBackArrows: 'faded',
|
||||
|
||||
// Display a presentation progress bar
|
||||
progress: true,
|
||||
|
||||
// Display the page number of the current slide
|
||||
slideNumber: 'c/t',
|
||||
|
||||
// 'all', 'print', or 'speaker'
|
||||
showSlideNumber: 'all',
|
||||
|
||||
// Add the current slide number to the URL hash so that reloading the
|
||||
// page/copying the URL will return you to the same slide
|
||||
hash: true,
|
||||
|
||||
// Start with 1 for the hash rather than 0
|
||||
hashOneBasedIndex: false,
|
||||
|
||||
// Flags if we should monitor the hash and change slides accordingly
|
||||
respondToHashChanges: true,
|
||||
|
||||
// Push each slide change to the browser history
|
||||
history: true,
|
||||
|
||||
// Enable keyboard shortcuts for navigation
|
||||
keyboard: true,
|
||||
|
||||
// Enable the slide overview mode
|
||||
overview: true,
|
||||
|
||||
// Disables the default reveal.js slide layout (scaling and centering)
|
||||
// so that you can use custom CSS layout
|
||||
disableLayout: false,
|
||||
|
||||
// Vertical centering of slides
|
||||
center: false,
|
||||
|
||||
// Enables touch navigation on devices with touch input
|
||||
touch: true,
|
||||
|
||||
// Loop the presentation
|
||||
loop: false,
|
||||
|
||||
// Change the presentation direction to be RTL
|
||||
rtl: false,
|
||||
|
||||
// see https://revealjs.com/vertical-slides/#navigation-mode
|
||||
navigationMode: 'linear',
|
||||
|
||||
// Randomizes the order of slides each time the presentation loads
|
||||
shuffle: false,
|
||||
|
||||
// Turns fragments on and off globally
|
||||
fragments: true,
|
||||
|
||||
// Flags whether to include the current fragment in the URL,
|
||||
// so that reloading brings you to the same fragment position
|
||||
fragmentInURL: false,
|
||||
|
||||
// Flags if the presentation is running in an embedded mode,
|
||||
// i.e. contained within a limited portion of the screen
|
||||
embedded: false,
|
||||
|
||||
// Flags if we should show a help overlay when the questionmark
|
||||
// key is pressed
|
||||
help: true,
|
||||
|
||||
// Flags if it should be possible to pause the presentation (blackout)
|
||||
pause: true,
|
||||
|
||||
// Flags if speaker notes should be visible to all viewers
|
||||
showNotes: false,
|
||||
|
||||
// Global override for autoplaying embedded media (null/true/false)
|
||||
autoPlayMedia: null,
|
||||
|
||||
// Global override for preloading lazy-loaded iframes (null/true/false)
|
||||
preloadIframes: null,
|
||||
|
||||
// Number of milliseconds between automatically proceeding to the
|
||||
// next slide, disabled when set to 0, this value can be overwritten
|
||||
// by using a data-autoslide attribute on your slides
|
||||
autoSlide: 0,
|
||||
|
||||
// Stop auto-sliding after user input
|
||||
autoSlideStoppable: true,
|
||||
|
||||
// Use this method for navigation when auto-sliding
|
||||
autoSlideMethod: null,
|
||||
|
||||
// Specify the average time in seconds that you think you will spend
|
||||
// presenting each slide. This is used to show a pacing timer in the
|
||||
// speaker view
|
||||
defaultTiming: null,
|
||||
|
||||
// Enable slide navigation via mouse wheel
|
||||
mouseWheel: false,
|
||||
|
||||
// The display mode that will be used to show slides
|
||||
display: 'block',
|
||||
|
||||
// Hide cursor if inactive
|
||||
hideInactiveCursor: true,
|
||||
|
||||
// Time before the cursor is hidden (in ms)
|
||||
hideCursorTime: 5000,
|
||||
|
||||
// Opens links in an iframe preview overlay
|
||||
previewLinks: false,
|
||||
|
||||
// Transition style (none/fade/slide/convex/concave/zoom)
|
||||
transition: 'none',
|
||||
|
||||
// Transition speed (default/fast/slow)
|
||||
transitionSpeed: 'default',
|
||||
|
||||
// Transition style for full page slide backgrounds
|
||||
// (none/fade/slide/convex/concave/zoom)
|
||||
backgroundTransition: 'none',
|
||||
|
||||
// Number of slides away from the current that are visible
|
||||
viewDistance: 3,
|
||||
|
||||
// Number of slides away from the current that are visible on mobile
|
||||
// devices. It is advisable to set this to a lower number than
|
||||
// viewDistance in order to save resources.
|
||||
mobileViewDistance: 2,
|
||||
|
||||
// The "normal" size of the presentation, aspect ratio will be preserved
|
||||
// when the presentation is scaled to fit different resolutions. Can be
|
||||
// specified using percentage units.
|
||||
width: 1050,
|
||||
|
||||
height: 700,
|
||||
|
||||
// Factor of the display size that should remain empty around the content
|
||||
margin: 0.1,
|
||||
|
||||
math: {
|
||||
mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js',
|
||||
config: 'TeX-AMS_HTML-full',
|
||||
tex2jax: {
|
||||
inlineMath: [['\\(','\\)']],
|
||||
displayMath: [['\\[','\\]']],
|
||||
balanceBraces: true,
|
||||
processEscapes: false,
|
||||
processRefs: true,
|
||||
processEnvironments: true,
|
||||
preview: 'TeX',
|
||||
skipTags: ['script','noscript','style','textarea','pre','code'],
|
||||
ignoreClass: 'tex2jax_ignore',
|
||||
processClass: 'tex2jax_process'
|
||||
},
|
||||
},
|
||||
|
||||
// reveal.js plugins
|
||||
plugins: [QuartoLineHighlight, PdfExport, RevealMenu, RevealChalkboard, RevealPointer, QuartoSupport,
|
||||
|
||||
RevealMath,
|
||||
RevealNotes,
|
||||
RevealSearch,
|
||||
RevealZoom
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// htmlwidgets need to know to resize themselves when slides are shown/hidden.
|
||||
// Fire the "slideenter" event (handled by htmlwidgets.js) when the current
|
||||
// slide changes (different for each slide format).
|
||||
(function () {
|
||||
// dispatch for htmlwidgets
|
||||
function fireSlideEnter() {
|
||||
const event = window.document.createEvent("Event");
|
||||
event.initEvent("slideenter", true, true);
|
||||
window.document.dispatchEvent(event);
|
||||
}
|
||||
|
||||
function fireSlideChanged(previousSlide, currentSlide) {
|
||||
fireSlideEnter();
|
||||
|
||||
// dispatch for shiny
|
||||
if (window.jQuery) {
|
||||
if (previousSlide) {
|
||||
window.jQuery(previousSlide).trigger("hidden");
|
||||
}
|
||||
if (currentSlide) {
|
||||
window.jQuery(currentSlide).trigger("shown");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// hookup for slidy
|
||||
if (window.w3c_slidy) {
|
||||
window.w3c_slidy.add_observer(function (slide_num) {
|
||||
// slide_num starts at position 1
|
||||
fireSlideChanged(null, w3c_slidy.slides[slide_num - 1]);
|
||||
});
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script id="quarto-html-after-body" type="application/javascript">
|
||||
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||||
const toggleBodyColorMode = (bsSheetEl) => {
|
||||
const mode = bsSheetEl.getAttribute("data-mode");
|
||||
const bodyEl = window.document.querySelector("body");
|
||||
if (mode === "dark") {
|
||||
bodyEl.classList.add("quarto-dark");
|
||||
bodyEl.classList.remove("quarto-light");
|
||||
} else {
|
||||
bodyEl.classList.add("quarto-light");
|
||||
bodyEl.classList.remove("quarto-dark");
|
||||
}
|
||||
}
|
||||
const toggleBodyColorPrimary = () => {
|
||||
const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
|
||||
if (bsSheetEl) {
|
||||
toggleBodyColorMode(bsSheetEl);
|
||||
}
|
||||
}
|
||||
toggleBodyColorPrimary();
|
||||
const tabsets = window.document.querySelectorAll(".panel-tabset-tabby")
|
||||
tabsets.forEach(function(tabset) {
|
||||
const tabby = new Tabby('#' + tabset.id);
|
||||
});
|
||||
const isCodeAnnotation = (el) => {
|
||||
for (const clz of el.classList) {
|
||||
if (clz.startsWith('code-annotation-')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const onCopySuccess = function(e) {
|
||||
// button target
|
||||
const button = e.trigger;
|
||||
// don't keep focus
|
||||
button.blur();
|
||||
// flash "checked"
|
||||
button.classList.add('code-copy-button-checked');
|
||||
var currentTitle = button.getAttribute("title");
|
||||
button.setAttribute("title", "已复制");
|
||||
let tooltip;
|
||||
if (window.bootstrap) {
|
||||
button.setAttribute("data-bs-toggle", "tooltip");
|
||||
button.setAttribute("data-bs-placement", "left");
|
||||
button.setAttribute("data-bs-title", "已复制");
|
||||
tooltip = new bootstrap.Tooltip(button,
|
||||
{ trigger: "manual",
|
||||
customClass: "code-copy-button-tooltip",
|
||||
offset: [0, -8]});
|
||||
tooltip.show();
|
||||
}
|
||||
setTimeout(function() {
|
||||
if (tooltip) {
|
||||
tooltip.hide();
|
||||
button.removeAttribute("data-bs-title");
|
||||
button.removeAttribute("data-bs-toggle");
|
||||
button.removeAttribute("data-bs-placement");
|
||||
}
|
||||
button.setAttribute("title", currentTitle);
|
||||
button.classList.remove('code-copy-button-checked');
|
||||
}, 1000);
|
||||
// clear code selection
|
||||
e.clearSelection();
|
||||
}
|
||||
const getTextToCopy = function(trigger) {
|
||||
const codeEl = trigger.previousElementSibling.cloneNode(true);
|
||||
for (const childEl of codeEl.children) {
|
||||
if (isCodeAnnotation(childEl)) {
|
||||
childEl.remove();
|
||||
}
|
||||
}
|
||||
return codeEl.innerText;
|
||||
}
|
||||
const clipboard = new window.ClipboardJS('.code-copy-button:not([data-in-quarto-modal])', {
|
||||
text: getTextToCopy
|
||||
});
|
||||
clipboard.on('success', onCopySuccess);
|
||||
if (window.document.getElementById('quarto-embedded-source-code-modal')) {
|
||||
const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', {
|
||||
text: getTextToCopy,
|
||||
container: window.document.getElementById('quarto-embedded-source-code-modal')
|
||||
});
|
||||
clipboardModal.on('success', onCopySuccess);
|
||||
}
|
||||
var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
|
||||
var mailtoRegex = new RegExp(/^mailto:/);
|
||||
var filterRegex = new RegExp("https:\/\/drc\.drwater\.net\/course\/public\/RWEP\/PUB");
|
||||
var isInternal = (href) => {
|
||||
return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
|
||||
}
|
||||
// Inspect non-navigation links and adorn them if external
|
||||
var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool):not(.about-link)');
|
||||
for (var i=0; i<links.length; i++) {
|
||||
const link = links[i];
|
||||
if (!isInternal(link.href)) {
|
||||
// undo the damage that might have been done by quarto-nav.js in the case of
|
||||
// links that we want to consider external
|
||||
if (link.dataset.originalHref !== undefined) {
|
||||
link.href = link.dataset.originalHref;
|
||||
}
|
||||
}
|
||||
}
|
||||
function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
|
||||
const config = {
|
||||
allowHTML: true,
|
||||
maxWidth: 500,
|
||||
delay: 100,
|
||||
arrow: false,
|
||||
appendTo: function(el) {
|
||||
return el.closest('section.slide') || el.parentElement;
|
||||
},
|
||||
interactive: true,
|
||||
interactiveBorder: 10,
|
||||
theme: 'light-border',
|
||||
placement: 'bottom-start',
|
||||
};
|
||||
if (contentFn) {
|
||||
config.content = contentFn;
|
||||
}
|
||||
if (onTriggerFn) {
|
||||
config.onTrigger = onTriggerFn;
|
||||
}
|
||||
if (onUntriggerFn) {
|
||||
config.onUntrigger = onUntriggerFn;
|
||||
}
|
||||
config['offset'] = [0,0];
|
||||
config['maxWidth'] = 700;
|
||||
window.tippy(el, config);
|
||||
}
|
||||
const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
|
||||
for (var i=0; i<noterefs.length; i++) {
|
||||
const ref = noterefs[i];
|
||||
tippyHover(ref, function() {
|
||||
// use id or data attribute instead here
|
||||
let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
|
||||
try { href = new URL(href).hash; } catch {}
|
||||
const id = href.replace(/^#\/?/, "");
|
||||
const note = window.document.getElementById(id);
|
||||
if (note) {
|
||||
return note.innerHTML;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
}
|
||||
const findCites = (el) => {
|
||||
const parentEl = el.parentElement;
|
||||
if (parentEl) {
|
||||
const cites = parentEl.dataset.cites;
|
||||
if (cites) {
|
||||
return {
|
||||
el,
|
||||
cites: cites.split(' ')
|
||||
};
|
||||
} else {
|
||||
return findCites(el.parentElement)
|
||||
}
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
|
||||
for (var i=0; i<bibliorefs.length; i++) {
|
||||
const ref = bibliorefs[i];
|
||||
const citeInfo = findCites(ref);
|
||||
if (citeInfo) {
|
||||
tippyHover(citeInfo.el, function() {
|
||||
var popup = window.document.createElement('div');
|
||||
citeInfo.cites.forEach(function(cite) {
|
||||
var citeDiv = window.document.createElement('div');
|
||||
citeDiv.classList.add('hanging-indent');
|
||||
citeDiv.classList.add('csl-entry');
|
||||
var biblioDiv = window.document.getElementById('ref-' + cite);
|
||||
if (biblioDiv) {
|
||||
citeDiv.innerHTML = biblioDiv.innerHTML;
|
||||
}
|
||||
popup.appendChild(citeDiv);
|
||||
});
|
||||
return popup.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body></html>
|
||||
66
SD/9_课后作业8/index.qmd
Normal file
66
SD/9_课后作业8/index.qmd
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
title: "课后作业8"
|
||||
subtitle: 《区域水环境污染数据分析实践》<br>Data analysis practice of regional water environment pollution
|
||||
author: 苏命、王为东<br>中国科学院大学资源与环境学院<br>中国科学院生态环境研究中心
|
||||
date: today
|
||||
lang: zh
|
||||
resources:
|
||||
- "*.pdf"
|
||||
- "*.sas"
|
||||
format:
|
||||
revealjs:
|
||||
theme: dark
|
||||
slide-number: true
|
||||
chalkboard:
|
||||
buttons: true
|
||||
preview-links: auto
|
||||
lang: zh
|
||||
toc: true
|
||||
toc-depth: 1
|
||||
toc-title: 大纲
|
||||
logo: ./_extensions/inst/img/ucaslogo.png
|
||||
css: ./_extensions/inst/css/revealjs.css
|
||||
pointer:
|
||||
key: "p"
|
||||
color: "#32cd32"
|
||||
pointerSize: 18
|
||||
revealjs-plugins:
|
||||
- pointer
|
||||
filters:
|
||||
- d2
|
||||
---
|
||||
|
||||
```{r}
|
||||
#| include: false
|
||||
#| cache: false
|
||||
lang <- "cn"
|
||||
require(tidyverse)
|
||||
require(learnr)
|
||||
```
|
||||
|
||||
## 第8次课后作业
|
||||
|
||||
1. 根据`airqualitydf.xlsx`,按采样点统计白天(8:00-20:00)与夜晚(20:00-8:00)中空气质量指数(AQI)中位数,按城市统计低于所有采样点AQI30%分位值的采样点占比,列出上述占比最高的10个城市(不考虑采样点数低于5个的城市)。
|
||||
2. 按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。
|
||||
|
||||
作业模板:[第8次课后作业_模板.qmd](https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/main/SD/20240328_9_课后作业/第8次课后作业_模板.qmd)
|
||||
|
||||
## 示例代码
|
||||
|
||||
### 基于R的示例结果
|
||||
|
||||
- [第8次课后作业R示例代码结果](./第8次课后作业_模板.html)
|
||||
|
||||
### 基于SAS的示例结果
|
||||
|
||||
- [第8次课后作业SAS示例代码](./第8次课后作业_模板.sas)
|
||||
- [第8次课后作业SAS示例结果1](./median.pdf)
|
||||
- [第8次课后作业SAS示例结果2](./freq.pdf)
|
||||
- [第8次课后作业SAS示例结果3](./airqualitymedianoutrow5.pdf)
|
||||
- [第8次课后作业SAS示例结果4](./npar1wayConover.pdf)
|
||||
|
||||
## 欢迎讨论!{.center}
|
||||
|
||||
|
||||
`r rmdify::slideend(wechat = FALSE, type = "public", tel = FALSE, thislink = "https://drwater.rcees.ac.cn/course/public/RWEP/@PUB/SD/")`
|
||||
|
||||
BIN
SD/9_课后作业8/median.pdf
Normal file
BIN
SD/9_课后作业8/median.pdf
Normal file
Binary file not shown.
BIN
SD/9_课后作业8/metadf.RDS
Normal file
BIN
SD/9_课后作业8/metadf.RDS
Normal file
Binary file not shown.
BIN
SD/9_课后作业8/npar1wayConover.pdf
Normal file
BIN
SD/9_课后作业8/npar1wayConover.pdf
Normal file
Binary file not shown.
BIN
SD/9_课后作业8/testdf.RDS
Normal file
BIN
SD/9_课后作业8/testdf.RDS
Normal file
Binary file not shown.
148
SD/9_课后作业8/第8次课后作业_模板.qmd
Normal file
148
SD/9_课后作业8/第8次课后作业_模板.qmd
Normal file
@@ -0,0 +1,148 @@
|
||||
---
|
||||
title: 课后作业8
|
||||
author: 姓名
|
||||
format: html
|
||||
---
|
||||
|
||||
# 数据
|
||||
|
||||
下载airquality.xlsx,并读取数据。
|
||||
|
||||
```{r}
|
||||
#| message: false
|
||||
#| warning: false
|
||||
# 下载至临时文件
|
||||
if (FALSE) {
|
||||
tmpxlsxpath <- file.path(tempdir(), "airquality.xlsx")
|
||||
download.file("https://drwater.rcees.ac.cn/git/course/RWEP/raw/branch/PUB/data/airquality.xlsx",
|
||||
destfile = tmpxlsxpath)
|
||||
airqualitydf <- readxl::read_xlsx(tmpxlsxpath, sheet = 2)
|
||||
metadf <- readxl::read_xlsx(tmpxlsxpath, sheet = 1)
|
||||
saveRDS(airqualitydf, "./airqualitydf.RDS")
|
||||
saveRDS(metadf, "./metadf.RDS")
|
||||
}
|
||||
airqualitydf <- readRDS("./airqualitydf.RDS")
|
||||
metadf <- readRDS("./metadf.RDS")
|
||||
```
|
||||
|
||||
# 描述统计
|
||||
|
||||
根据`airqualitydf.xlsx`,按采样点统计白天(8:00-20:00)与夜晚(20:00-8:00)中空气质量指数(AQI)中位数,按城市统计低于所有采样点AQI30%分位值的采样点占比,列出上述占比最高的10个城市(不考虑采样点数低于5个的城市)。
|
||||
|
||||
```{r}
|
||||
#| message: false
|
||||
#| warning: false
|
||||
require(tidyverse)
|
||||
airqualitydf |>
|
||||
select(datetime, site, AQI) |>
|
||||
filter(!is.na(AQI)) |>
|
||||
group_by(site) |>
|
||||
summarize(AQI.median = median(AQI, na.rm = TRUE)) |>
|
||||
left_join(metadf |> select(site, city = Area)) |>
|
||||
group_by(city) |>
|
||||
filter(n() > 5) |>
|
||||
summarize(p = sum(AQI.median < quantile(airqualitydf$AQI, probs = 0.5, na.rm = TRUE)) / n()) |>
|
||||
top_n(10, p)
|
||||
|
||||
|
||||
airqualitydf |>
|
||||
select(datetime, site, AQI) |>
|
||||
filter(!is.na(AQI)) |>
|
||||
group_by(site) |>
|
||||
summarize(AQI.median = median(AQI, na.rm = TRUE))
|
||||
|
||||
airqualitydf |>
|
||||
select(datetime, site, AQI) |>
|
||||
filter(!is.na(AQI)) |>
|
||||
left_join(metadf |> select(site, city = Area)) |>
|
||||
group_by(city) |>
|
||||
filter(length(unique(site)) >= 5) |>
|
||||
summarize(p = sum(AQI < quantile(airqualitydf$AQI, probs = 0.2,
|
||||
na.rm = TRUE)) / n()) |>
|
||||
slice_max(p, n = 10) |>
|
||||
knitr::kable()
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
# 统计检验
|
||||
|
||||
按照不同城市分组,统计白天与夜晚AQI中位数是否具有显著差异。
|
||||
|
||||
```{r}
|
||||
#| message: false
|
||||
#| warning: false
|
||||
|
||||
if (FALSE) {
|
||||
require(infer)
|
||||
require(tidyverse)
|
||||
testdf <- airqualitydf |>
|
||||
select(datetime, site, AQI) |>
|
||||
filter(!is.na(AQI)) |>
|
||||
left_join(metadf |> select(site, city = Area)) |>
|
||||
group_by(city) |>
|
||||
filter(length(unique(site)) >= 5) |>
|
||||
mutate(dayornight = factor(ifelse(between(hour(datetime), 8, 20), "day", "night"),
|
||||
levels = c("day", "night"))
|
||||
) |>
|
||||
group_by(city) |>
|
||||
nest(citydf = -city) |>
|
||||
mutate(median_diff = purrr::map_dbl(citydf, ~
|
||||
.x |>
|
||||
specify(AQI ~ dayornight) |>
|
||||
calculate(stat = "diff in medians", order = c("day", "night")) |>
|
||||
pull(stat)
|
||||
)) |>
|
||||
ungroup() |>
|
||||
# slice_sample(n = 12) |>
|
||||
mutate(null_dist = purrr::map(citydf, ~
|
||||
.x |>
|
||||
specify(AQI ~ dayornight) |>
|
||||
hypothesize(null = "independence") |>
|
||||
generate(reps = 1000, type = "permute") |>
|
||||
calculate(stat = "diff in medians", order = c("day", "night"))
|
||||
)) |>
|
||||
mutate(p_value = purrr::map2_dbl(null_dist, median_diff,
|
||||
~ get_p_value(.x, obs_stat = .y, direction = "both") |>
|
||||
pull(p_value)
|
||||
)) |>
|
||||
mutate(sigdiff = ifelse(p_value < 0.01, "显著差异", "无显著差异")) |>
|
||||
mutate(fig = purrr::pmap(list(null_dist, median_diff, city, sigdiff),
|
||||
~ visualize(..1) +
|
||||
shade_p_value(obs_stat = ..2, direction = "both") +
|
||||
ggtitle(paste0(..3, ":", ..4)) +
|
||||
theme_sci(2, 2)
|
||||
)) |>
|
||||
arrange(p_value)
|
||||
saveRDS(testdf, "./testdf.RDS")
|
||||
}
|
||||
|
||||
lang <- "cn"
|
||||
require(dwfun)
|
||||
require(rmdify)
|
||||
require(drwateR)
|
||||
dwfun::init()
|
||||
rmdify::rmd_init()
|
||||
|
||||
testdf <- readRDS("./testdf.RDS")
|
||||
require(tidyverse)
|
||||
testdf |>
|
||||
select(city, median_diff, p_value, sigdiff) |>
|
||||
knitr::kable()
|
||||
testdf |>
|
||||
mutate(grp = (row_number() - 1)%/% 12) |>
|
||||
group_by(grp) |>
|
||||
nest(grpdf = -grp) |>
|
||||
ungroup() |>
|
||||
# slice(1) |>
|
||||
mutate(gp = purrr::map(grpdf,
|
||||
~(.x |>
|
||||
pull(fig)) |>
|
||||
patchwork::wrap_plots(ncol = 3) +
|
||||
dwfun::theme_sci(5, 7))) |>
|
||||
pull(gp)
|
||||
|
||||
|
||||
```
|
||||
|
||||
289
SD/9_课后作业8/第8次课后作业_模板.sas
Normal file
289
SD/9_课后作业8/第8次课后作业_模板.sas
Normal file
@@ -0,0 +1,289 @@
|
||||
options ls=256 ps=32767 nodate validmemname=extend validvarname=any;
|
||||
|
||||
title 'The SAS System';
|
||||
|
||||
%macro print(d);
|
||||
proc print data=&d;run;
|
||||
%mend;
|
||||
%macro printobs(d,obs);
|
||||
proc print data=&d (obs=&obs);run;
|
||||
%mend;
|
||||
%macro printfirstobsobs(d,firstobs,obs);
|
||||
proc print data=&d (firstobs=&firstobs obs=&obs);run;
|
||||
%mend;
|
||||
%macro contents(d);
|
||||
proc contents data=&d varnum;run;
|
||||
%mend;
|
||||
%macro contentsshort(d);
|
||||
proc contents data=&d varnum short;run;
|
||||
%mend;
|
||||
%macro save_dataset(d);
|
||||
data "d:&d";
|
||||
set &d;
|
||||
run;
|
||||
%mend;
|
||||
%macro load_dataset(d);
|
||||
data &d;
|
||||
set "d:&d";
|
||||
run;
|
||||
%mend;
|
||||
%macro kill;
|
||||
PROC DATASETS LIB=work KILL;RUN;quit;
|
||||
%mend;
|
||||
proc template;
|
||||
list styles;
|
||||
run;
|
||||
|
||||
|
||||
|
||||
%kill;
|
||||
PROC IMPORT OUT=WORK.raw_metadf
|
||||
DATAFILE="d:airquality.xlsx"
|
||||
DBMS=EXCEL REPLACE;
|
||||
RANGE="metadf$";
|
||||
GETNAMES=YES;
|
||||
MIXED=YES;
|
||||
SCANTEXT=YES;
|
||||
USEDATE=NO;
|
||||
SCANTIME=NO;
|
||||
RUN;
|
||||
%print(raw_metadf);
|
||||
%save_dataset(raw_metadf); *ԭʼ<D4AD><CABC><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>;
|
||||
|
||||
PROC IMPORT OUT=WORK.raw_airqualitydf
|
||||
DATAFILE="d:airquality.xlsx"
|
||||
DBMS=EXCEL REPLACE;
|
||||
RANGE="airqualitydf$";
|
||||
GETNAMES=YES;
|
||||
MIXED=YES;
|
||||
SCANTEXT=YES;
|
||||
USEDATE=NO; *ΪYES<45><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
SCANTIME=NO; *ΪYES<45><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
RUN;
|
||||
%print(raw_airqualitydf);
|
||||
%save_dataset(raw_airqualitydf); *ԭʼ<D4AD><CABC><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>;
|
||||
|
||||
|
||||
%kill;
|
||||
/*<2A><><EFBFBD><EFBFBD>Ӳ<EFBFBD><D3B2>ԭʼ<D4AD><CABC><EFBFBD>ݼ<EFBFBD>*/
|
||||
%load_dataset(raw_metadf);
|
||||
%load_dataset(raw_airqualitydf);
|
||||
/*<2A>鿴<EFBFBD><E9BFB4><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
%contents(raw_metadf);
|
||||
%contentsshort(raw_metadf);
|
||||
/*site name Area lon lat*/
|
||||
%contents(raw_airqualitydf);
|
||||
%contentsshort(raw_airqualitydf);
|
||||
/*datetime site 'CO_mg/m3'n 'CO_24h_mg/m3'n 'NO2_<32><5F>g/m3'n 'NO2_24h_<68><5F>g/m3'n 'O3_<33><5F>g/m3'n 'O3_24h_<68><5F>g/m3'n 'O3_8h_<68><5F>g/m3'n 'O3_8h_24h_<68><5F>g/m3'n 'PM10_<30><5F>g/m3'n 'PM10_24h_<68><5F>g/m3'n 'PM2#5_<35><5F>g/m3'n 'PM2#5_24h_<68><5F>g/m3'n 'SO2_<32><5F>g/m3'n 'SO2_24h_<68><5F>g/m3'n AQI PrimaryPollutant Quality Unheathful*/
|
||||
|
||||
%printobs(raw_metadf,10);
|
||||
%printobs(raw_airqualitydf,10);
|
||||
proc sort data=raw_metadf out=metadfsorted;
|
||||
by site;
|
||||
run;
|
||||
proc sort data=raw_airqualitydf out=airqualitydfsorted;
|
||||
by site;
|
||||
run;
|
||||
/*<2A>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD>ڡ<EFBFBD>ʱ<EFBFBD>䲿<EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD>day<61><79>night*/
|
||||
data airquality;
|
||||
retain datetime date time DayNight site name Area AQI lon lat;
|
||||
length DayNight $ 5;
|
||||
merge metadfsorted airqualitydfsorted;
|
||||
by site;
|
||||
date=datepart(datetime);
|
||||
time=timepart(datetime);
|
||||
if '8:00't<=time<'20:00't then DayNight='day';
|
||||
else DayNight='night';
|
||||
format datetime e8601dt25. date yymmdd10. time time5.;
|
||||
keep site name Area lon lat datetime date time DayNight AQI;
|
||||
run;
|
||||
%printobs(airquality,100);
|
||||
%save_dataset(airquality); *<2A>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>;
|
||||
|
||||
|
||||
|
||||
%kill;
|
||||
/*#################### DATA SET airquality ####################*/
|
||||
/*<2A><><EFBFBD><EFBFBD>Ӳ<EFBFBD>̺ϲ<CCBA><CFB2><EFBFBD><EFBFBD>ݼ<EFBFBD>*/
|
||||
%load_dataset(airquality);
|
||||
%printobs(airquality,100);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD>site<74><65>name<6D><65><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD>ֲ<EFBFBD>һ<EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD>site<74><65><EFBFBD><EFBFBD>ͳ<EFBFBD><CDB3>*/
|
||||
proc sql;
|
||||
select count(distinct(site)) as count_site from airquality;
|
||||
select count(distinct(name)) as count_name from airquality;
|
||||
quit;
|
||||
/*
|
||||
count_site
|
||||
1714
|
||||
count_name
|
||||
1522
|
||||
*/
|
||||
|
||||
|
||||
/*#########################################################################*/
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>ư<EFBFBD><C6B0>죨8:00-20:00<30><30><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9><EFBFBD><EFBFBD>20:00-8:00<30><30><EFBFBD>п<EFBFBD><D0BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>AQI<51><49><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>*/
|
||||
/*#########################################################################*/
|
||||
/*@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@*/
|
||||
ods pdf file='d:means.pdf' style=sapphire dpi=1200;
|
||||
proc means data=airquality median maxdec=1;
|
||||
class site DayNight;
|
||||
var AQI;
|
||||
where AQI is not missing;
|
||||
run;
|
||||
ods pdf close;
|
||||
/*@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@*/
|
||||
|
||||
|
||||
/*####################################################################################################*/
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ȣ<EFBFBD><C8A3>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>10<31><30><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD>ij<EFBFBD><C4B3>У<EFBFBD>*/
|
||||
/*####################################################################################################*/
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB><D6B5>Ϊ<EFBFBD><CEAA>SQL<51><4C>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ*/
|
||||
proc univariate data=airquality noprint;
|
||||
var AQI;
|
||||
output out=airqualitystats pctlpts=30 pctlpre=P;
|
||||
run;
|
||||
%print(airqualitystats); /*42*/
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
proc sql;
|
||||
select AQI into : xvalues separated by ',' from airquality;
|
||||
select distinct(pctl(30, &xvalues)) into : P30 from airquality;
|
||||
quit;
|
||||
/*<2A>鿴<EFBFBD><E9BFB4><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
%put P30=&P30.;
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB><D6B5>AQI<51>ּ<EFBFBD><D6BC><EFBFBD><EFBFBD>Ժϲ<D4BA><CFB2><EFBFBD><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>ӷּ<D3B7><D6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD><EFBFBD><EFBFBD>ȥ*/
|
||||
data airquality1;
|
||||
set airquality;
|
||||
if AQI<&P30. then quality='good';
|
||||
else quality='fair';
|
||||
run;
|
||||
%printobs(airquality1,100);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI<51><49>λ<EFBFBD><CEBB>*/
|
||||
proc means data=airquality median maxdec=1;
|
||||
class Area site;
|
||||
var AQI;
|
||||
where AQI is not missing;
|
||||
output out=airqualitymedian median=;
|
||||
run;
|
||||
%print(airqualitymedian);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB><D6B5>AQI<51><49>λ<EFBFBD><CEBB><EFBFBD>ּ<EFBFBD>*/
|
||||
data airqualitymedian1;
|
||||
set airqualitymedian;
|
||||
if AQI<&P30. then quality='good';
|
||||
else quality='fair';
|
||||
where _TYPE_=3;
|
||||
run;
|
||||
%print(airqualitymedian1);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ȣ<EFBFBD><C8A3>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD>*/
|
||||
/*@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@*/
|
||||
ods pdf file='d:freq.pdf' style=sapphire dpi=1200;
|
||||
proc freq data=airqualitymedian1;
|
||||
table Area*quality /nocol nopercent;
|
||||
run;
|
||||
ods pdf close;
|
||||
/*@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@*/
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD>AQI30%<25><>λֵ<CEBB>IJ<EFBFBD><C4B2><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>ͳ<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>*/
|
||||
proc freq data=airqualitymedian1;
|
||||
table Area*quality /outpct out=airqualitymedianoutrow(drop=percent pct_col); *<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD><EFBFBD>аٷֱ<D9B7>;
|
||||
run;
|
||||
%printobs(airqualitymedianoutrow,100);
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>жԲ<D0B6><D4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>ƣ<EFBFBD><C6A3>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ*/
|
||||
proc means data=airqualitymedianoutrow sum maxdec=0;
|
||||
class Area;
|
||||
var COUNT;
|
||||
run;
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD>ij<EFBFBD><C4B3>У<EFBFBD><D0A3>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ*/
|
||||
proc sql;
|
||||
select *,sum(COUNT) as total_COUNT from airqualitymedianoutrow group by Area having calculated total_COUNT>=5 order by quality desc,PCT_ROW desc,COUNT desc;
|
||||
quit;
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD>ij<EFBFBD><C4B3>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>*/
|
||||
proc sql;
|
||||
create table airqualitymedianoutrow5 as select *,sum(COUNT) as total_COUNT from airqualitymedianoutrow group by Area having calculated total_COUNT>=5 order by quality desc,PCT_ROW desc,COUNT desc;
|
||||
quit;
|
||||
/*<2A>г<EFBFBD><D0B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD>10<31><30><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD>ij<EFBFBD><C4B3>У<EFBFBD>*/
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
ods pdf file='d:airqualitymedianoutrow5.pdf' style=sapphire dpi=1200;
|
||||
%printobs(airqualitymedianoutrow5,10);
|
||||
%printobs(airqualitymedianoutrow5,20);
|
||||
%printobs(airqualitymedianoutrow5,30);
|
||||
%print(airqualitymedianoutrow5);
|
||||
ods pdf close;
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
|
||||
|
||||
/*#####################################################*/
|
||||
/*<2A><><EFBFBD>ղ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>з<EFBFBD><D0B7>飬ͳ<E9A3AC>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9>AQI<51><49>λ<EFBFBD><CEBB><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
/*#####################################################*/
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>siteû<65><C3BB>Area<65><61>Ӧ*/
|
||||
proc sql;
|
||||
select distinct(Area),count(distinct(Area)) as count_Area from airquality;
|
||||
quit;
|
||||
proc print data=airquality;
|
||||
where Area is missing;
|
||||
run;
|
||||
proc sql;
|
||||
select distinct(site),count(distinct(site)) as count_site from airquality where Area is missing;
|
||||
quit;
|
||||
/*<2A><>4<EFBFBD><34>site<74><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㣩û<E3A3A9><C3BB>Area<65><61><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD>Ӧ
|
||||
site count_site
|
||||
2628A 4
|
||||
3128A 4
|
||||
4034A 4
|
||||
4036A 4
|
||||
*/
|
||||
proc sort data=airquality out=airqualitysorted;
|
||||
by Area;
|
||||
run;
|
||||
/*<2A><><EFBFBD>ղ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>з<EFBFBD><D0B7>飬ͳ<E9A3AC>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9>AQI<51><49>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ*/
|
||||
proc means data=airqualitysorted median maxdec=1;
|
||||
by Area;
|
||||
class DayNight;
|
||||
var AQI;
|
||||
where AQI is not missing;
|
||||
run;
|
||||
/*<2A><>ͳ<EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9>AQI<51><49>λ<EFBFBD><CEBB><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
proc npar1way data=airquality median;
|
||||
class DayNight;
|
||||
var AQI;
|
||||
run;
|
||||
/*<2A><><EFBFBD>ղ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>з<EFBFBD><D0B7>飬ͳ<E9A3AC>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>ҹ<EFBFBD><D2B9>AQI<51><49>λ<EFBFBD><CEBB><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
ods pdf file='d:npar1waymedian.pdf' style=sapphire dpi=1200;
|
||||
proc npar1way data=airqualitysorted median;
|
||||
class DayNight;
|
||||
var AQI;
|
||||
by Area;
|
||||
where Area is not missing;
|
||||
run;
|
||||
ods pdf close;
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
/*
|
||||
Using Wilcoxon scores in the linear rank statistic for two-sample data produces the rank sum statistic of the Mann-Whitney-Wilcoxon test.
|
||||
Using Wilcoxon scores in the one-way ANOVA statistic produces the Kruskal-Wallis test.
|
||||
Wilcoxon scores are locally most powerful for location shifts of a logistic distribution.
|
||||
*//*
|
||||
Using median scores in the linear rank statistic for two-sample data produces the two-sample median test.
|
||||
The one-way ANOVA statistic with median scores is equivalent to the Brown-Mood test.
|
||||
Median scores are particularly powerful for distributions that are symmetric and heavy-tailed.*/
|
||||
|
||||
/*
|
||||
Scores for Linear Rank and One-Way ANOVA Tests
|
||||
For each score type that you specify, PROC NPAR1WAY computes a one-way ANOVA statistic and also a linear rank statistic for two-sample data. The following score types are used primarily to test for differences in location: Wilcoxon, median, Van der Waerden (normal), and Savage. The following scores types are used to test for scale differences: Siegel-Tukey, Ansari-Bradley, Klotz, and Mood. Conover scores can be used to test for differences in both location and scale. This section gives formulas for the score types available in PROC NPAR1WAY. For further information about the formulas and the applicability of each score, see Randles and Wolfe (1979), Gibbons and Chakraborti (2010), Conover (1999), and Hollander and Wolfe (1999).
|
||||
In addition to the score types described in this section, you can specify the SCORES=DATA option to use the input data observations as scores. This enables you to produce a wide variety of tests. You can construct any scores by using the DATA step, and then you can use PROC NPAR1WAY to compute the corresponding linear rank and one-way ANOVA tests for these scores. You can also analyze raw (unscored) data by using the SCORES=DATA option; for two-sample data, the corresponding exact test is a permutation test that is known as Pitman<61><6E>s test.
|
||||
*/
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
ods pdf file='d:npar1wayConover.pdf' style=sapphire dpi=1200;
|
||||
proc npar1way data=airqualitysorted Conover;
|
||||
class DayNight;
|
||||
var AQI;
|
||||
by Area;
|
||||
where Area is not missing;
|
||||
run;
|
||||
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@ PDF @@@@@@@@@@@@@@@@@@@@@@@@@*/
|
||||
/*Conover scores can be used to test for differences in both location and scale.*/
|
||||
Reference in New Issue
Block a user