XRay Instrumentation¶
| Version: | 1 as of 2016-11-08 |
|---|
Introduction¶
XRay is a function call tracing system which combines compiler-inserted instrumentation points and a runtime library that can dynamically enable and disable the instrumentation.
More high level information about XRay can be found in the XRay whitepaper.
This document describes how to use XRay as implemented in LLVM.
XRay in LLVM¶
XRay consists of three main parts:
Compiler-inserted instrumentation points.
A runtime library for enabling/disabling tracing at runtime.
A suite of tools for analysing the traces.
NOTE: As of February 27, 2017 , XRay is only available for the following architectures running Linux: x86_64, arm7 (no thumb), aarch64, powerpc64le, mips, mipsel, mips64, mips64el.
The compiler-inserted instrumentation points come in the form of nop-sleds in
the final generated binary, and an ELF section named xray_instr_map
which
contains entries pointing to these instrumentation points. The runtime library
relies on being able to access the entries of the xray_instr_map
, and
overwrite the instrumentation points at runtime.
Using XRay¶
You can use XRay in a couple of ways:
- Instrumenting your C/C++/Objective-C/Objective-C++ application.
- Generating LLVM IR with the correct function attributes.
The rest of this section covers these main ways and later on how to customise what XRay does in an XRay-instrumented binary.
Instrumenting your C/C++/Objective-C Application¶
The easiest way of getting XRay instrumentation for your application is by
enabling the -fxray-instrument
flag in your clang invocation.
For example:
clang -fxray-instrument ..
By default, functions that have at least 200 instructions will get XRay
instrumentation points. You can tweak that number through the
-fxray-instruction-threshold=
flag:
clang -fxray-instrument -fxray-instruction-threshold=1 ..
You can also specifically instrument functions in your binary to either always or never be instrumented using source-level attributes. You can do it using the GCC-style attributes or C++11-style attributes.
[[clang::xray_always_instrument]] void always_instrumented();
[[clang::xray_never_instrument]] void never_instrumented();
void alt_always_instrumented() __attribute__((xray_always_instrument));
void alt_never_instrumented() __attribute__((xray_never_instrument));
When linking a binary, you can either manually link in the XRay Runtime
Library or use clang
to link it in automatically with the
-fxray-instrument
flag. Alternatively, you can statically link-in the XRay
runtime library from compiler-rt – those archive files will take the name of
libclang_rt.xray-{arch} where {arch} is the mnemonic supported by clang
(x86_64, arm7, etc.).
LLVM Function Attribute¶
If you’re using LLVM IR directly, you can add the function-instrument
string attribute to your functions, to get the similar effect that the
C/C++/Objective-C source-level attributes would get:
define i32 @always_instrument() uwtable "function-instrument"="xray-always" {
; ...
}
define i32 @never_instrument() uwtable "function-instrument"="xray-never" {
; ...
}
You can also set the xray-instruction-threshold
attribute and provide a
numeric string value for how many instructions should be in the function before
it gets instrumented.
define i32 @maybe_instrument() uwtable "xray-instruction-threshold"="2" {
; ...
}
XRay Runtime Library¶
The XRay Runtime Library is part of the compiler-rt project, which implements
the runtime components that perform the patching and unpatching of inserted
instrumentation points. When you use clang
to link your binaries and the
-fxray-instrument
flag, it will automatically link in the XRay runtime.
The default implementation of the XRay runtime will enable XRay instrumentation
before main
starts, which works for applications that have a short
lifetime. This implementation also records all function entry and exit events
which may result in a lot of records in the resulting trace.
Also by default the filename of the XRay trace is xray-log.XXXXXX
where the
XXXXXX
part is randomly generated.
These options can be controlled through the XRAY_OPTIONS
environment
variable, where we list down the options and their defaults below.
| Option | Type | Default | Description |
|---|---|---|---|
| patch_premain | bool |
false |
Whether to patch instrumentation points before main. |
| xray_mode | const char* |
"" |
Default mode to
install and initialize
before main . |
| xray_logfile_base | const char* |
xray-log. |
Filename base for the XRay logfile. |
| xray_naive_log | bool |
false |
DEPRECATED: Use xray_mode=xray-basic instead. Whether to install the basic log the naive log implementation. |
| xray_fdr_log | bool |
false |
DEPRECATED: Use xray_mode=xray-fdr instead. Whether to install the Flight Data Recorder (FDR) mode. |
| verbosity | int |
0 |
Runtime verbosity level. |
If you choose to not use the default logging implementation that comes with the
XRay runtime and/or control when/how the XRay instrumentation runs, you may use
the XRay APIs directly for doing so. To do this, you’ll need to include the
xray_interface.h
from the compiler-rt xray
directory. The important API
functions we list below:
__xray_set_handler(void (*entry)(int32_t, XRayEntryType))
: Install your own logging handler for when an event is encountered. Seexray/xray_interface.h
for more details.__xray_remove_handler()
: Removes whatever the installed handler is.__xray_patch()
: Patch all the instrumentation points defined in the binary.__xray_unpatch()
: Unpatch the instrumentation points defined in the binary.
There are some requirements on the logging handler to be installed for the thread-safety of operations to be performed by the XRay runtime library:
- The function should be thread-safe, as multiple threads may be invoking the function at the same time. If the logging function needs to do synchronisation, it must do so internally as XRay does not provide any synchronisation guarantees outside from the atomicity of updates to the pointer.
- The pointer provided to
__xray_set_handler(...)
must be live even after calls to__xray_remove_handler()
and__xray_unpatch()
have succeeded. XRay cannot guarantee that all threads that have ever gotten a copy of the pointer will not invoke the function.
Flight Data Recorder Mode¶
XRay supports a logging mode which allows the application to only capture a
fixed amount of memory’s worth of events. Flight Data Recorder (FDR) mode works
very much like a plane’s “black box” which keeps recording data to memory in a
fixed-size circular queue of buffers, and have the data available
programmatically until the buffers are finalized and flushed. To use FDR mode
on your application, you may set the xray_fdr_log
option to true
in the
XRAY_OPTIONS
environment variable (while also optionally setting the
xray_naive_log
to false
).
When the buffers are flushed to disk, the result is a binary trace format described by XRay FDR format
When FDR mode is on, it will keep writing and recycling memory buffers until the logging implementation is finalized – at which point it can be flushed and re-initialised later. To do this programmatically, we follow the workflow provided below:
// Patch the sleds, if we haven't yet.
auto patch_status = __xray_patch();
// Maybe handle the patch_status errors.
// When we want to flush the log, we need to finalize it first, to give
// threads a chance to return buffers to the queue.
auto finalize_status = __xray_log_finalize();
if (finalize_status != XRAY_LOG_FINALIZED) {
// maybe retry, or bail out.
}
// At this point, we are sure that the log is finalized, so we may try
// flushing the log.
auto flush_status = __xray_log_flushLog();
if (flush_status != XRAY_LOG_FLUSHED) {
// maybe retry, or bail out.
}
The default settings for the FDR mode implementation will create logs named similarly to the naive log implementation, but will have a different log format. All the trace analysis tools (and the trace reading library) will support all versions of the FDR mode format as we add more functionality and record types in the future.
NOTE: We do not however promise perpetual support for when we update the log versions we support going forward. Deprecation of the formats will be announced and discussed on the developers mailing list.
XRay allows for replacing the default FDR mode logging implementation using the following API:
__xray_set_log_impl(...)
: This function takes a struct of typeXRayLogImpl
, which is defined inxray/xray_log_interface.h
, part of the XRay compiler-rt installation.__xray_log_register_mode(...)
: Register a logging implementation against a string Mode. The implementation is an instance ofXRayLogImpl
defined inxray/xray_log_interface.h
.__xray_log_select_mode(...)
: Select the mode to install, associated with a string Mode. Only implementations registered with__xray_log_register_mode(...)
can be chosen with this function. When successful, has the same effects as calling__xray_set_log_impl(...)
with the registered logging implementation.__xray_log_init(...)
: This function allows for initializing and re-initializing an installed logging implementation. Seexray/xray_log_interface.h
for details, part of the XRay compiler-rt installation.
Trace Analysis Tools¶
We currently have the beginnings of a trace analysis tool in LLVM, which can be
found in the tools/llvm-xray
directory. The llvm-xray
tool currently
supports the following subcommands:
extract
: Extract the instrumentation map from a binary, and return it as YAML.account
: Performs basic function call accounting statistics with various options for sorting, and output formats (supports CSV, YAML, and console-friendly TEXT).convert
: Converts an XRay log file from one format to another. We can convert from binary XRay traces (both naive and FDR mode) to YAML, flame-graph friendly text formats, as well as Chrome Trace Viewer (catapult) <https://github.com/catapult-project/catapult> formats.graph
: Generates a DOT graph of the function call relationships between functions found in an XRay trace.stack
: Reconstructs function call stacks from a timeline of function calls in an XRay trace.
These subcommands use various library components found as part of the XRay libraries, distributed with the LLVM distribution. These are:
llvm/XRay/Trace.h
: A trace reading library for conveniently loading an XRay trace of supported forms, into a convenient in-memory representation. All the analysis tools that deal with traces use this implementation.llvm/XRay/Graph.h
: A semi-generic graph type used by the graph subcommand to conveniently represent a function call graph with statistics associated with edges and vertices.llvm/XRay/InstrumentationMap.h
: A convenient tool for analyzing the instrumentation map in XRay-instrumented object files and binaries. Theextract
andstack
subcommands uses this particular library.
Future Work¶
There are a number of ongoing efforts for expanding the toolset building around the XRay instrumentation system.
Trace Analysis Tools¶
- Work is in progress to integrate with or develop tools to visualize findings
from an XRay trace. Particularly, the
stack
tool is being expanded to output formats that allow graphing and exploring the duration of time in each call stack. - With a large instrumented binary, the size of generated XRay traces can quickly become unwieldy. We are working on integrating pruning techniques and heuristics for the analysis tools to sift through the traces and surface only relevant information.
More Platforms¶
We’re looking forward to contributions to port XRay to more architectures and operating systems.


WATCH: Browns Fans Swing Helmet at Mason Rudolph Pinata | Breitbart
Browns fans have taken Cleveland defensive end Myles Garrett’s attack on Steelers quarterback Mason Rudolph, and turned it into a tailgating event.
by Dylan GwinnOn November 14th, Garrett tore Rudolph’s helmet off and swung it at him, striking the Pittsburgh quarterback in the head. Ten days later, Browns fans decided it would be fun to construct a Mason Rudolph pinata, and swing a helmet at that.
Though, this time the helmet swinger was blindfolded.
The penalty flags were a nice touch. In the background, a “Free Myles Garrett” sign can be seen. Earlier this week, Garrett had his suspension upheld by the league, meaning that the star defensive player will miss the rest of the season. Though, there’s talk that Garrett’s suspension will not extend until next year.
Rudolph was fined $50,000 for his part in the altercation.
Follow Dylan Gwinn on Twitter @themightygwinn


class: center, middle, inverse, title-slide # Hypothesis Test ## ⚔ A general guideline ###
Yuan Du ###
11-07-2019
Updated: 2020-10-01 --- layout: false class: bg-main3 split-30 hide-slide-number .column[ ] .column.slide-in-right[.content.vmiddle[ .sliderbox.shade_main.pad1[ .font5[Welcome !] ] ]] --- class: bg-main1 # Recap from Statistical Basics course ### Dataset (Column, Row) ✔ -- ### Data type ✔ -- ### Scatter plot, bar chart, etc ✔ -- ### Interpret significance test ✔ --
 ###For more statistical classes please contact: ###Office of Research Integrity<EMAIL_ADDRESS>or Meghan<EMAIL_ADDRESS>--- class: bg-main1 # Data Type
--- class: middle center bg-main1 #Chart suggestions ![ ](https://blog-sap.com/analytics/files/2016/12/12.9.vinay_chart.jpg) --- class: bg-main1 #P-value ###- P-value or significance is a probability, thus bounded by 0 and 1. -- ###- A test p-value provides the probability indicating statistical significance. -- ###- If the p-value is less than 0.05 (typically used value for statistical testing), then the study results are statistically significant. --
 ###.yellow[**Note**] There is an ongoing debate on misusing p-value. and New England Jounal of Medicine in July,2019 published the [new Statistical Reporting Guidelines](https://www.nejm.org/author-center/new-manuscripts). --- class: split-two white .column.bg-main1[.content[ # Interpret significance test -- ###There is a statistically significant difference/reduction/increase on .yellow[outcome] between groups/pre&post (.green[p-value=...]). ]] .column.bg-main2[.content.vmiddle.center[ ###.green[Example 1:] The mean time score difference from pre to post is 5.18 compared to 14.45. There is a statistically significant increase in time scores from pre to post (p-value <0.001) using .black[paired sample t test]. --

 ###.yellow[Example 2:] Gender and ASA are independent based on the .black[Chi-square test] (p-value = .8826). The percentage of female and male patients is not different between the ASA types. ]] --- class: bg-main1 # Class Objectives ![](https://media.giphy.com/media/vx1S8MddJ11JQLTXaB/giphy.gif) ##
 Let's get started!
-- ###-Construct hypothesis -- ##-.green[Outcome is numerical] (Parametric test & Non-parametric test) -- ##-.yellow[Outcome is categorical] --- class: bg-main1 background-image: url(https://i.imgflip.com/vghl4.jpg) --- class: split-two white .column.bg-main1[.content[ # Hypothesis
 ###- Null hypothesis (H0): Assumption of the test holds and is failed to be rejected at some level of significance.
 ###- Alternate hypothesis (H1): Assumption of the test does not hold and is rejected at some level of significance. ]] .column.bg-main2[.content.vmiddle.center[ ###**Example**: suppose someone claims that 20 (80%) of 25 patients who received drug A were cured, compared to 12 (48%) of 25 patients who received drug B. -- ###- H0: the two treatments are equally effective and the observed difference arose by chance
 ###- H1: one treatment is better than the other. ]] --- class: bg-main1 ###.white[Side note:] However, it is essential to note that the P value does not provide a direct answer. Let us assume in this case the statistician does a significance test and gets a P value = .04, meaning that the difference is statistically significant (P < .05). But as explained earlier, this does not mean that there is a 4% probability that the null hypothesis is true and 96% chance that the alternative hypothesis is true. The P value is a frequential probability and it provides the information that there is a 4% probability of obtaining such a difference between the cure rates, if the null hypothesis is true.
 ###In probability, this would be written as follows: ###P(\theta.red[/H0]) --- class: split-two white .column.bg-main1[.content[ ##**Assumptions for parametric test:**
 ###- Sample is derived from a population with a normal distribution.- a “bell-shaped curve.” ####(The sample size is large enough for the central limit theorem to lead to normality of averages) ###- Variance is homogeneous. ###- Data are measured at interval level. ]] .column.bg-main2[.content[ ##**Assumptions for nonparametric test is not free:**
 ###- Distinctly non-normal and cannot be transformed ###- Sample size is too small for the central limit theorem to lead to normality of averages ###- Nominal or ordinal ]] --- class: split-two white .column.bg-main1[.content[ `(Repeated Measures are not included-more than two matched groups)` #.green[Most widely used parametric tests are:]
 ###- paired t-test (dependent/matched two groups) ###- (unpaired) t-test (independent two groups) ###- ANOVA (more than two groups) ###- Pearson correlation ]] .column.bg-main2[.content[ `(Repeated Measures are not included-more than two matched groups)` #.green[Most widely used non parametric tests are:]
 ###- Wilcoxon signed ranks test (paired two groups) ###- Wilcoxon Mann whitney test (independent two groups) ###- Kruskal Wallis test (more than two groups) ###- Spearman correlation ]] --- class: middle center bg-main1 #Hypothesis test summary table (Simple version) ![](https://ars.els-cdn.com/content/image/3-s2.0-B9780123736956000156-f15-27-9780123736956.gif?_) --- class: split-60 white .column.bg-main1[.content[ #.green[Example 1] (Independent T test):
 ###Patients cared under Teaching physician group has lower cost. There is a significant lower cost in the teaching physician group than in the non teaching group ($10060 Vs $18631.37 , p-value<0.001) by t test. ```r *t.test(Cost_Observed ~ Physician_Group, data = Data) ``` ]] .column.bg-main3[.content.vmiddle.center[ # This tells the `R` to run t test. ]] --- class: split-60 white .column.bg-main1[.content[ ###The output shows "Welch two sample t test" which means that the variance between two groups are not equal. Some software automatically show the right result for you like R. Some provide both results and you need to choose one based on the estimate pooled variance test result. ###We can roughly check the variances: ```r Welch Two Sample t-test data: Cost_Observed by Physician_Group *t = -10.305, df = 980.71, p-value < 2.2e-16 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -10203.21 -6938.82 sample estimates: mean in group 1 mean in group 2 10060.36 18631.37 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 4 ## Physician_Group GroupVariance Mean total.count ## <dbl> <dbl> <dbl> <int> ## 1 1 141627419. 10060. 357 ## 2 2 560053334. 18631. 1898 ``` ]] .column.bg-main3[.content.vmiddle.center[ # This is the P-value for the t test ]] --- class: split-60 white .column.bg-main1[.content[ ###The output shows "Welch two sample t test" which means that the variance between two groups are not equal. Some software automatically show the right result for you like R. Some provide both results and you need to choose one based on the estimate pooled variance test result. ###We can roughly check the variances: ```r Welch Two Sample t-test data: Cost_Observed by Physician_Group t = -10.305, df = 980.71, p-value < 2.2e-16 *alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -10203.21 -6938.82 sample estimates: mean in group 1 mean in group 2 10060.36 18631.37 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 4 ## Physician_Group GroupVariance Mean total.count ## <dbl> <dbl> <dbl> <int> ## 1 1 141627419. 10060. 357 ## 2 2 560053334. 18631. 1898 ``` ]] .column.bg-main3[.content.vmiddle.center[ # This is the alternative hypothesis for the t test ]] --- class: split-60 white .column.bg-main1[.content[ ###The output shows "Welch two sample t test" which means that the variance between two groups are not equal. Some software automatically show the right result for you like R. Some provide both results and you need to choose one based on the estimate pooled variance test result. ###We can roughly check the variances: ```r Welch Two Sample t-test data: Cost_Observed by Physician_Group t = -10.305, df = 980.71, p-value < 2.2e-16 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -10203.21 -6938.82 sample estimates: *mean in group 1 mean in group 2 * 10060.36 18631.37 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 4 ## Physician_Group GroupVariance Mean total.count ## <dbl> <dbl> <dbl> <int> ## 1 1 141627419. 10060. 357 ## 2 2 560053334. 18631. 1898 ``` ]] .column.bg-main3[.content.vmiddle.center[ # This is the mean by group for the t test
 # The table below is the variance by group ]] --- class: bg-main1 #.green[Example 2] (Wilcoxon Mann Whitney test)： -- ###Patients cared under Teaching physician group has lower LOS. There is a significant lower LOS in the teaching physician group than in the non teaching group ( 3 days Vs 5 days, p-value<0.001) by Wilcoxon Mann whitney test. ``` ## ## Wilcoxon rank sum test with continuity correction ## ## data: LOS_Observed by Physician_Group ## W = 245515, p-value < 2.2e-16 ## alternative hypothesis: true location shift is not equal to 0 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 3 ## Physician_Group Median total.count ## <dbl> <dbl> <int> ## 1 1 3 357 ## 2 2 5 1898 ``` --- class: bg-main1 #.green[Example 3] (ANOVA test)： -- ###Patients with different insurance has different cost (p-value=0.001) by ANOVA test. ``` ## Df Sum Sq Mean Sq F value Pr(>F) ## Insurance_Type 6 1.099e+10 1.832e+09 3.664 0.00127 ** ## Residuals 2248 1.124e+12 5.000e+08 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 7 x 3 ## Insurance_Type Mean total.count ## <chr> <dbl> <int> ## 1 COMMERCIAL - INDEMNITY 21453. 72 ## 2 MANAGED CARE 20340. 254 ## 3 MEDICAID 18070. 269 ## 4 MEDICARE 17117. 1343 ## 5 OTHER GOVERNMENT PAYORS 16963. 139 ## 6 SELF PAY 10873. 169 ## 7 WORKERS COMPENSATION 22032. 9 ``` --- class: bg-main1 #.green[Example 4] (Kruskal Wallis test)： -- ###Patients with different insurance has different LOS (p-value=0.001) by Kruskal Wallis test. ``` ## ## Kruskal-Wallis rank sum test ## ## data: LOS_Observed by Insurance_Type ## Kruskal-Wallis chi-squared = 18.39, df = 6, p-value = 0.005329 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 7 x 3 ## Insurance_Type Median total.count ## <chr> <dbl> <int> ## 1 COMMERCIAL - INDEMNITY 5 72 ## 2 MANAGED CARE 5 254 ## 3 MEDICAID 5 269 ## 4 MEDICARE 5 1343 ## 5 OTHER GOVERNMENT PAYORS 5 139 ## 6 SELF PAY 4 169 ## 7 WORKERS COMPENSATION 4 9 ``` --- class: bg-main1 #.green[Example 5] (Paired sample t test)： -- ###We Assume the two physician groups had an intervention on reducing medical cost by reducing number of consults. We have a post cost that could compare with previous cost. ``` ## ## Paired t-test ## ## data: Cost by group ## t = 0.00073398, df = 2254, p-value = 0.9994 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -1235.300 1236.225 ## sample estimates: ## mean of the differences ## 0.4625277 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 5 ## group count mean sd max ## <fct> <int> <dbl> <dbl> <dbl> ## 1 After 2255 16973. 22447. 243710. ## 2 Before 2255 16973. 22432. 243299. ``` --- class: bg-main1 #.green[Example 6] (Wilcoxon signed ranks test)： -- ###We Assume the two physician groups had an intervention on reducing LOS by reducing number of consults. We have a post LOS that could compare with previous LOS. ``` ## ## Wilcoxon signed rank test with continuity correction ## ## data: LOS by group ## V = 0, p-value < 2.2e-16 ## alternative hypothesis: true location shift is not equal to 0 ``` ``` ## `summarise()` ungrouping output (override with `.groups` argument) ``` ``` ## # A tibble: 2 x 5 ## group count mean sd median ## <fct> <int> <dbl> <dbl> <dbl> ## 1 After 2255 3.57 4.96 2 ## 2 Before 2255 7.16 8.01 5 ``` --- class: split-two white .column.bg-main1[.content[ ##We want to see if there is correlation between Age and Cost, a linear relationship between two continuous variables #.green[Pearson correlation test:]
 ```r cor.test(Data$Age, Data$Cost_Observed) ``` ``` ## ## Pearson's product-moment correlation ## ## data: Data$Age and Data$Cost_Observed ## t = -0.67119, df = 2253, p-value = 0.5022 ## alternative hypothesis: true correlation is not equal to 0 ## 95 percent confidence interval: ## -0.05538456 0.02715466 ## sample estimates: ## cor ## -0.01413904 ``` ]] .column.bg-main2[.content[ ##We want to see if there is correlation between Number of consults and LOS, a monotonic relationship between two continuous or ordinal variables #.green[Spearman correlation test:]
 ```r cor.test(Data$Number_of_consults, Data$Cost_Observed, method = "spearman") ``` ]] --- class: bg-main1 #Class Activity (Outcome is .yellow[categorical] or .green[Numerical] ): ###In groups of 2-4: Please match the statement (.green[green font]) with the appropriate statistical test (.black[black font])
 ###Variables include Age, Gender, Cost, LOS, Readmission, Mortality, Physician Group, Insurance type
 ###.purple[Note]: Assume normal distribution of Age, Cost; non-normal distribution of LOS, number of consults. --- class: bg-main1 #.yellow[Outcome is categorical] -- #Chi-square test ###Example: Test the hypothesis Insurance is independent of Gender at .05 significance level. ``` ## Warning in chisq.test(table(Data$Insurance_Type, Data$Gender)): Chi-squared ## approximation may be incorrect ``` ``` ## ## Pearson's Chi-squared test ## ## data: table(Data$Insurance_Type, Data$Gender) ## X-squared = 107.83, df = 6, p-value < 2.2e-16 ``` -- ``` ## ## Female Male ## COMMERCIAL - INDEMNITY 36 36 ## MANAGED CARE 113 141 ## MEDICAID 118 151 ## MEDICARE 682 661 ## OTHER GOVERNMENT PAYORS 10 129 ## SELF PAY 57 112 ## WORKERS COMPENSATION 4 5 ``` --- class: bg-main1 #Enhanced Solution (easy way) - comebine insurance categories ``` ## Female Male ## [1,] 113 141 ## [2,] 118 151 ## [3,] 682 661 ## [4,] 57 112 ## [5,] 50 170 ``` -- ``` ## ## Pearson's Chi-squared test ## ## data: rtbl ## X-squared = 70.963, df = 4, p-value = 1.421e-14 ``` --- class: bg-main1 #Fisher exact test (sample size is small/more than 25% of cells is less than 5) ###Example: Test the hypothesis Insurance is independent of Race (Only American Indian and Asian). ``` ## ## AMERICAN INDIAN ASIAN BLACK OTHER WHITE ## COMMERCIAL - INDEMNITY 0 1 15 6 50 ## MANAGED CARE 1 1 21 10 221 ## MEDICAID 1 0 96 6 166 ## MEDICARE 11 6 184 60 1082 ## OTHER GOVERNMENT PAYORS 0 0 21 5 113 ## SELF PAY 0 0 21 8 140 ## WORKERS COMPENSATION 0 0 0 0 9 ``` -- ``` ## ## AMERICAN INDIAN ASIAN ## COMMERCIAL - INDEMNITY 0 1 ## MANAGED CARE 1 1 ## MEDICAID 1 0 ## MEDICARE 11 6 ``` ``` ## ## Fisher's Exact Test for Count Data ## ## data: table(Prace$Insurance_Type, Prace$Race) ## p-value = 0.8089 ## alternative hypothesis: two.sided ``` --- class: bg-main1 ##Summary: -- ###-Construct hypothesis ✔ -- ###-.green[Outcome is numerical] (Parametric test & Non-parametric test) ✔ -- ###-.yellow[Outcome is categorical] ✔ --- class: middle center bg-main1 ###*For additional hypothesis test, please refer to* [https://stats.idre.ucla.edu/other/mult-pkg/whatstat/]()
 #Thanks!
 ### My personal blog about Statistics and Data Science: [

https://yuan-du.com]() ### If you have statistical questions, please email: [

yuan.du@adventhealth.com]().
 ####Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan).


Latests News
{% for new, img, des, pubAt, url in context%}
News:
{{new}}
Description
{{des}}
Published at
{{pubAt}}
Read More
{%endfor%}


Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
R
randomColor()
- Method in class ch.epfl.lis.gnwgui.
GnwGuiSettings
Return a random color in the RGB format.
randomInitialization()
- Method in class ch.epfl.lis.gnw.
Gene
Random initialization of all parameters and the gene regulation function
randomInitialization()
- Method in class ch.epfl.lis.gnw.
GeneNetwork
Random initialization of the dynamical model (based on the fixed topology defined by W_)
randomInitializationOfParameters()
- Method in class ch.epfl.lis.gnw.
RegulatoryModule
Random initialization of parameter values.
RandomParameter
- Class in
ch.epfl.lis.gnw
Interface for the classes handling the generation of random parameter values.
RandomParameterConstant
- Class in
ch.epfl.lis.gnw
A constant parameter
RandomParameterConstant(double)
- Constructor for class ch.epfl.lis.gnw.
RandomParameterConstant
Default constructor
RandomParameterGaussian
- Class in
ch.epfl.lis.gnw
Generate random values from a Gaussian distribution within the interval [min max].
RandomParameterGaussian(double, double, boolean)
- Constructor for class ch.epfl.lis.gnw.
RandomParameterGaussian
Constructor, mean_ and stdev_ are set according to the specified interval (see class documentation above)
RandomParameterGaussian(double, double, double, double, boolean)
- Constructor for class ch.epfl.lis.gnw.
RandomParameterGaussian
Constructor, mean_ and stdev_ are set explicitly
RandomParameterUniform
- Class in
ch.epfl.lis.gnw
Generate random values from a Uniform distribution within the interval [min max].
readDrosophilaPouya()
- Method in class ch.epfl.lis.gnw.
TSVParserGNW
Reads the Drosophila regulatory network that Pouya sent me.
readRegulonDB()
- Method in class ch.epfl.lis.gnw.
TSVParserGNW
Read a RegulonDB flat file of TF-gene interactions.
recalculateColumnWidths(IElement)
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Recalculates the column width of the one that contains the given element.
recalculateColumnWidths(int)
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Recalculates the column width specified.
rectangularArrow_
- Static variable in class ch.epfl.lis.gnwgui.jungtransformers.
ArrowShapeTransformer
Rectangular arrow
refreshDesktop()
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Refreshing the desktop consists to recalculate the widths of the columns and repainting the desktop.
RegulatoryModule
- Class in
ch.epfl.lis.gnw
A HillGene is independently regulated by one ore more regulatory modules.
RegulatoryModule()
- Constructor for class ch.epfl.lis.gnw.
RegulatoryModule
Constructor
reloadSettings()
- Method in class ch.epfl.lis.gnwgui.
GnwGui
removeItemFromDesktop(IElement)
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Remove the given element on the desktop.
removeMouseEntry()
- Method in class ch.epfl.lis.gnwgui.idesktop.
IElement
removeSignatureFromContainer()
- Method in class ch.epfl.lis.gnwgui.
GraphSignature
Remove this signature from the container
Rename
- Class in
ch.epfl.lis.gnwgui
This dialog is used to rename a network.
Rename(Frame, IElement)
- Constructor for class ch.epfl.lis.gnwgui.
Rename
Constructor
renameAction()
- Method in class ch.epfl.lis.gnwgui.
Options
Open a dialog to rename the network.
RenameWindow
- Class in
ch.epfl.lis.gnwgui.windows
This dialog is used to rename a network.
RenameWindow(Frame)
- Constructor for class ch.epfl.lis.gnwgui.windows.
RenameWindow
Constructor
repaintDesktop()
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Repaint the elements on the desktop accordingly to content_.
replaceItem(IElement, IElement)
- Method in class ch.epfl.lis.gnwgui.idesktop.
IDesktop
Replace the item1 on the desktop by item2.
reset()
- Method in class ch.epfl.lis.sde.
Milstein
Cleanup the solver
reset()
- Method in class ch.epfl.lis.sde.
SdeSolver
Cleanup the solver
restoreWildType()
- Method in class ch.epfl.lis.gnw.
Perturbation
Restore the values before perturbations were applied
restoreWildType()
- Method in class ch.epfl.lis.gnw.
PerturbationMultifactorial
Restore the values before perturbations were applied
restoreWildType()
- Method in class ch.epfl.lis.gnw.
PerturbationSingleGene
Restore the values before perturbations were applied
restoreWildTypeBasalActivation()
- Method in class ch.epfl.lis.gnw.
Gene
Restore the wild-type basal activation
restoreWildTypeBasalActivation()
- Method in class ch.epfl.lis.gnw.
HillGene
Restore the wild-type basal activation
RGB2HexaColor(Color)
- Static method in class ch.epfl.lis.gnwgui.
GnwGuiSettings
Convert an instance of Color into hexa format.
RGB2HexaColor(Color)
- Static method in class ch.epfl.lis.gnwgui.idesktop.
IElement
run(DoubleMatrix1D)
- Method in class ch.epfl.lis.gnw.
SteadyStateExperiment
Run all steady-state experiments
run(DoubleMatrix1D)
- Method in class ch.epfl.lis.gnw.
TimeSeriesExperiment
Run all experiments
run()
- Method in class ch.epfl.lis.gnwgui.
SubnetExtraction.NetworkExtractionThread
Run function
run()
- Method in class ch.epfl.lis.gnwgui.
SubnetExtraction
Run the subnets extraction process using the user-defined parameters.
run()
- Method in class ch.epfl.lis.gnwgui.windows.
WaitingSnake
Run function
run(int)
- Method in class ch.epfl.lis.sde.
SdeSolver
Standard function to integrate easily a SDE.
runExtraction(String, int, int)
- Method in class ch.epfl.lis.gnw.
SubnetExtractor
Extract multiple subnetworks from the given source network.
runExtraction(String, int, ArrayList<ArrayList<Node>>)
- Method in class ch.epfl.lis.gnw.
SubnetExtractor
Extract multiple subnetworks from the given source network.
RUNGEKUTTA
- Static variable in class ch.epfl.lis.sde.
SdeSolverFactory
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W


{extend name="layout/layout"} {block name="content"}
Sales ＆ Brand Promotion Organization
Not a member? Create Account


10
1 The king after Abimelech was Tola son of Puah and grandson of Dodo. He became the leader to rescue the Israelite people from their enemies. He was from tribe of Issachar, and yet he lived in the city of Shamir in the hill country of the tribe of Ephraim.
2 He ruled as judge over Israel for twenty-three years. Then he died and was buried in Shamir.
3 After Tola died, Jair (the Gileadite) ruled as judge over Israel for twenty-two years.
4 He had thirty sons, and each of them had his own donkey to ride on. They had thirty cities in Gilead that are still named even today, Havvoth Jair (or the Cities of Jair).
5 Then Jair died and was buried in the city of Kamon.
6 The Israelites did even more evil that Yahweh saw them do. They worshiped the Baal idols and female fertility idols called the Asthoreths. They worshiped the gods of the people groups of Aram, Sidon, Moab, and Ammon people groups, and the gods of the Philistines. They forgot about Yahweh and stopped worshiping him.
7 So Yahweh was very angry with them, and he allowed the Philistines and Ammonites to conquer Israel.
8 They crushed and oppressed the Israelites that year, and for eighteen years they oppressed all the people of Israel who lived on the east side of the Jordan River. That was the land of the Amorites, which is in Gilead.
9 Then the Amonites crossed over the Jordan River to fight against the people of the tribes of Judah, Benjamin, and Ephraim. They caused the Israelites' to live their lives with great fear and dread.
10 So the Israelites cried out to Yahweh, saying "We have sinned against you. We have abandoned you, and we have worshiped the idols of Baal."
11 Yahweh answered them, saying, "I delivered you from the people groups of the Egyptians, the Amorites, the Ammonites, the Philistines,
12 and also from the Sidonians, the Amalekites, and the Maonites. I did this because they hurt and imprisoned you. You cried out to me, and I brought you to freedom.
13 But now you have abandoned me, and you have been worshiping other gods. Therefore, I will not rescue you again and again.
14 You have chosen those gods to be the ones you worship. So ask them to help you.
15 But the people of Israel said to Yahweh, "We have sinned. Punish us in whatever way you wish. But please rescue us today!"
16 Then the Israelites threw away the idols of the foreign gods they had cherished, and they worshiped Yahweh. He saw that they were suffering very much, and he became impatient with Israel because of the misery they caused themselves.
17 The Ammon people group gathered to fight against the Israelites, and they set up their tents in Gilead. The Israelite soldiers gathered and set up their tents at Mizpah.
18 The leaders of the people of Gilead said to each other, "Who will lead our attack against the Ammonite army? The one who will lead us will become the leader of all us who live in Gilead."


Date
Form ID
BUYER
First Name
Last Name
Address
City
PinCode
Aadhar Number
Ration ID
Phone No.
SELLER
First Name
Last Name
Address
City
PinCode
Aadhar Number
Ration ID
Phone No.
LAND DETAILS
Date
Survey Field Number
Address
City
PinCode
North Neighbour
South Neighbour
East Neighbour
West Neighbour
North Measurement
South Measurement
East Measurement
West Measurement
Total Area
Rate Per Sq. Meter
Total Cost in word
Total Cost


the term stateful logic
is not ubiquitous. it just means
logic codified (i.e. code) that interacts with state in any way. it can be
logic that only reads from the state or logic that updates the state.
in our lesson today, we will be using custom hooks to write code that interacts with state in a reusable way.
stateful logic
in this application?
we want to create a hook that will allow us to reuse the
stateful logic
of dealing with forms. we want to be able to
specify different fields and have the hook deal with the updates of the
state as things are entered into field.
email
by copy/pasting/hooks
directory and a
useForm.js
file within
useState
methods into the form and have the form
return the state vars and the update methods
useForm
in SignupForm.js
clearForm
into the hookhandleChanges
within the hook
for the two fields
useForm
use a customizable initial
value object
useState
except it save the values locally
useLocalStorage.js
in /hooks
useState
hook and then call it
from useForm
useState
useLocalStorage.js
and passing it back as the
setValues
param


Trusted Currency Authority
Currency Conversion Tool
Enter USD value amount:
Enter currency type:
Get Converted Rate


---
layout: layouts/post.njk
title: "Interview on The Start FM"
permalink: /the-start/
date: '2016-04-05'
comments: true
tags:
- interview
- podcast
- history
- personal
description: "I was interviewed for one of my favorite podcasts ever: The Start FM. The conversation is about how I got to be where I am now and what it means to be so young in the industry."
link-out: http://thestart.fm/interviews/the-unacorn
---
If you are not redirected, please visit this think!


Brief Biography
I was born and raised in Washington State.
I like cats, old movies, and dark beer.
Wakingskating and Karoake are my favorite pastime.
Currently because of Code Fellows 201 learning to
code is my avoction and I hope will become my
professional vocation.
Professional Strengths
- Collaborative Leader
- Lucid Thinker
- Exemplary Communicator
- Trusted Mentor
Career Experiences
- Parish Pastor
- School Board Director
- Internship Supervisor
- Football Coach
Education Experience
- Kentridge H.S.
- University of Washington (B.A.Philosophy)
- Luther Seminary (M.Div)