Links to R scripts

Return to Main page

The following table summarizes the scripts that I have developed and/or used in the class. They are in alphabetic order by file name (which is pretty much the same as the function name except when there are multiple functions in a file). The table gives the script name, the a link to a file that holds the script, the date of the last update of the script, and a brief description of the script.
Script NameFile NamesLast Update Brief Description of what the script does
       
papfelton()
qapfelton()
apfelton.R 2016/02/15 Probability density functions for the Apfelton Distribution (see web pages)
assess_normality() assess_normality.R 2016/10/10 Produces a plot to help assess if a set of values is normally distributed.
pblumenkopf()
qblumenkopf()
blumenkopf.R 2016/02/15 Probability density functions for the Blumenkopf Distribution (see web pages)
ci_2known() ci_2known.R 2016/02/16 Finds the confidence interval for a the difference of two population means where we know both population standard deviation and we have a samples of size n_one and n_two with sample means called x_one and x_two.
ci_2popproportion() ci_2popproport.R 2016/02/27 Finds the confidence interval for a the difference of two population proportions where we have a samples of size n_one and n_two with sample successes called x_one and x_two.
ci_2popvar() ci_2popvar.R 2016/03/04 Finds the confidence interval for the ratio of two population variances where we have a samples of size n_top and n_bot with sample standard deviations called s_top and s_bot.
ci_2unknown() ci_2unknown.R 2016/02/23 Finds the confidence interval for a the difference of two population means where we do not know the population standard deviation and we have a samples of size n_one and n_two with sample means called x_one and x_two, and sample standard deviations called s_one and s_two. Results are given for both the simple degrees of freedom and the computed degrees of freedom.
ci_known() ci_known.R 2016/01/31 Finds the confidence interval for a popultion mean where we know the population standard deviation and we have a sample of size n with a sample mean called x_bar.
ci_prop() ci_prop.R 2016/02/27 Computes a confidence interval for the proportion given the sample size, the number of items with the characteristic, and the confidence level.
ci_stddev() ci_stddev.R 2016/01/31 Finds the confidence interval for a population standard deviation based on a sample size, sample standard deviation, and confidence level desired.
ci_unknown() ci_unknown.R 2016/01/31 Finds the confidence interval for a popultion mean where we do not know the population standard deviation but we do have a sample of size n with a sample mean called x_bar and a sample standard deviation called s.
collate3() collate3.R 2016/01/31 This script produces a frequency table for non-discrete data. The script is often run twice, first with just the data specified and second, based upon the output of the first run, with the dta, the low value of the first "bucket" and the bucket width. The name is left over from a program developed on the TI83/84 calculators to do the same thing.
num_comb()
nCr()
num_perm()
nPr()
combinations.R 2016/02/15 Functions to do combinations of n things taken r at a time. (Note this includes the functions for permutations as well.)
crosstab() crosstab.R 2016/03/08 Function to provide not only the cross tabulation for a matrix but also to provide the expected values, the row, column, and total percents, and the intermediate steps to perform a χ² test for independence on the original matrix.
dot_plot() dot_plot.R 2016/01/31 Produces a dot plot of the data.
find_samp_size() findsampsize.R 2016/03/07 For confidence intervals for the population mean, this function finds the required sample size for a desired margin of error value given the population standard deviation and the confidence level.
gnrnd4() gnrnd4.R 2016/01/31 This script generates data in the variable L1, and possibly in L2, depending upon two, or three, keys that are supplied as arguments to the function. It is typical to have these arguments supplied on test questions so that you can create tables of data that are identical to those given on the test. The use of the function is described in gnrnd4.htm.
gnrnd5() gnrnd5.R 2017/08/12 This script generates data in the variable L1, and possibly in L2, or in one case, in matrix_A depending upon two, or three, keys that are supplied as arguments to the function. It is typical to have these arguments supplied on test questions so that you can create tables of data that are identical to those given on the test. The use of the function is described in gnrnd5.htm.
hypoth_2test_known() hypo_2known.R 2016/02/16 This script performs a test on H0: &mu1; - μ2 = 0 against one of the standard alterntive hypotheses based on two samples, of size n_one and n_two, that give us a sample means mean_one and mean_two, and where we know the standard deviations of the underlying populations. We also need to specify the desired level of significance.
hypoth_2test_prop() hypo_2popproport.R 2016/02/27 This script performs a test on H0: p1; - p2 = 0 against one of the standard alterntive hypotheses based on two samples, of size n_one and n_two, that give us a sample success counts x_one and x_two. We also need to specify the desired level of significance.
hypoth_2test_unknown() hypo_2unknown.R 2016/02/23 This script performs a test on H0: &mu1; - μ2 = 0 against one of the standard alterntive hypotheses based on two samples, of size n_one and n_two, that give us a sample means mean_one and mean_two, and the sample standard deviations s_one and s_two. We also need to specify the desired level of significance. Results are given for both the simple degrees of freedom and the computed degrees of freedom.
hypoth_2test_var() hypo_2var.R 2016/03/04 This script performs a test on the equality of two population variances. The populations need to be normal. Arguments for the function include the sample sizes, n_top and n_bot, and the two sample standard deviations, s_top and s_bot. The type of the alternative hypothesis and the level of significance are also arguments.
hypoth_test_known() hypo_known.R 2016/03/15
revised
This script performs a test on H0: μ = a against one of the standard alterntive hypotheses based on a sample of size n that gives us a sample mean, x_bar, and where we know the standard deviation of the underlying population. We also need to specify the desired level of significance.
hypoth_test_prop() hypo_prop.R 2016/02/05 This script performs a test on H0: p; = a against one of the standard alterntive hypotheses based on a sample of size n that gives us a count, x, of the items in the sample that display the characteristic of interest. We also need to specify the desired level of significance.
hypoth_test_sigma() hypo_sigma.R 2016/02/09 This script performs a test on H0: σ = a against one of the standard alterntive hypotheses based on a sample of size n that gives us a sample standard deviation, s. We also need to specify the desired level of significance. The test should only be used if you are quite sure that the underlying population has a normal distribution.
hypoth_test_unknown() hypo_unknown.R 2016/03/15
revised
This script performs a test on H0: μ = a against one of the standard alterntive hypotheses based on a sample of size n that gives us a sample mean, x_bar, and where we do not know the standard deviation of the underlying population. We also need to specify the desired level of significance.
make_freq_table() make_freq_table.R 2016/01/31 This script create a frequency table for given discrete data.
Mode() mode.R 2016/01/31 Find the mode value or values in a set of values. Note that the function name starts with an upper case M. The function "mode() is defined in R but it has a different use.
model model.R 2016/09/19 This is not a function at all. This is a dummy file that I gave to students on their USB drive but which some of them have managed to delete. It is listed here so that students can save it to their USB dirive if need be.
num_perm()
nPr()
permutations.R 2016/02/15 Functions to do permutations of n things taken r at a time.
pbinomeq()
nPr()
pbinomeq.R 2016/02/15 This is a small function to find the probability of exactly one number, k, of success in n trials with a probability of success given as p.
pop_sd() pop_sd.R 2016/01/31 Computes the population standard devation given the raw data.
pprop() pprop.R 2016/02/02 Computes the normal approximation for the probability of getting phat (or less) from a proportion with probability of success p and sample size n.
stem_leaf() stem_leaf.R 2016/01/31 This script creates a stem and leaf diagram of the data where the user specifie the data and the position of the cut betwween the stem and the leaf values.
  starter.R 2016/03/23 This file just contains comments. It is meant to be downloaded and then used as a starting point for an RStudio session.
Return to Main page

©Roger M. Palay     Saline, MI 48176     August, 2017