fmsbパッケージマニュアル (A manual for the fmsb package) fmsbパッケージはCRANに登録されていますので,CRANからinstall.packages("fmsb")としてインストールすることをお薦めします。 {{{ 一覧表 (a list of datasets and functions) 日本の人口データ(Demographic data of Japan) 以下6つのデータフレームと1つの数値ベクトルは,library(fmsb)またはrequire(fmsb)としただけで利用可能になる。 The 6 dataframes and a numeric vector below become available just when you load this library by library(fmsb) or require(fmsb). JASM 日本の死亡データ Japanese mortality data Jlife 日本の完全生命表 Complete life tables in Japan Jfert 日本の年齢別出生率及び年齢別有配偶出生率 Age-specific fertility rates and age-specific marital fertility rates in Japan Jpop センサスによる日本の人口構造データ(「0歳」~「85歳以上」まで) Census-based Japanese population structure data (age 0 to "85+") Jpopl センサスによる日本の人口構造データ(「0歳」~「110歳以上」まで) Census-based Japanese population structure data (age 0 to "110+") Jvital 日本のいくつかの人口動態統計についての長期データ Longitudinal data of several vital statistics in Japan Jvital2013byPref 日本のいくつかの人口動態統計について,2013年の都道府県別データ Cross sectional data of several vital statistics in Japan for each prefecture in 2013 S60MPJ 昭和60年(1985年)の日本人の年齢5歳階級別基準人口 Model standard population structure of Japan in Showa 60 (1985) グラフの描画(Drawing special graphs) 以下の描画関数では標準の低レベル関数しか使っていないので,すべてのグラフィックデバイスに出力できるはずである。ただしpar(cex=2)などは利くものと利かないものが存在するので注意されたい。詳しくは個別の関数の説明を参照されたい。 Since only standard low-level functions are used in the drawing functions below, the graphs may be drawn in any graphic device. However, please pay attention to the fact that the effectiveness of par(cex=2) varies case by case. Please read the explanations of each function linked below. gstem 幹葉表示をグラフィックデバイスに出力する Draw the stem and leaf plot in a graphic device. mhchart 出産暦図(see, Wood JW, 1994)を描く Draw maternity history charts. plot.roc ROC分析の結果としてのrocクラスオブジェクトをROC曲線として描画する Calculate Receiver Operating Characteristic (ROC) curve pvalueplot p値関数を描く Drawing p-value function plot by a cross table radarchart レーダーチャート(スパイダープロット,蜘蛛の巣図とも呼ばれる)を描く Drawing radar chart (a.k.a. spider plot) 人口モデルに関連する関数群(Functions related to demographic models) いくつかの人口モデルの関数定義を含む,人口分析に関連した関数群。生命表関連の関数群の中では,lxがl(0)=100000であることに注意。 Several functions related to demographic analyses, especially including the definitions of demographic models. Among lifetable functions, note that l(0) is 100000 for lx. GompertzMakeham 3パラメータのGompertz-Makehamモデルの死力関数μ(x)を返す The force of mortality μ(x) generated by the 3 parameters Gompertz-Makeham model. fitGM optim()関数によりGompertz-Makehamモデルのqxへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する Automatically find the parameters which minimize the root mean square error (RMSE) of fitting Gompertz-Makeham model into qx, using optim(). Siler 5パラメータのSilerモデルのqxを返す qx generated by the 5 parameters Siler model. fitSiler optim()関数によりSilerモデルのqxへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する Denny 3パラメータのDennyモデルのl(x)を返す。l(0)は100000であることに注意。 Returns l(x) of Denny's model with 3 parameters. Note that l(0) is 100000. fitDenny optim()関数によりDennyモデルのlxへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する CM 3パラメータのCoale-McNeilモデルによる年齢別初婚確率と既婚率を返す fitCM optim()関数によりCoale-McNeilモデルの年齢別初婚確率または既婚率データへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する CT 2パラメータのCoale-Trussellモデルによる年齢別有配偶出生率(ASMFR)を返す fitCT optim()関数によりCoale-TrussellモデルのASMFRデータへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する Hadwiger 3パラメータのHadwigerモデルによる年齢別出生率(ASFR)を返す fitHad optim()関数によりHadwigerモデルのASFRデータへの当てはめの残差の平均平方和の平方根(RMSE)を最小にするパラメータを自動探索する lxtodx Convertion function from lx to dx. dxtolx Convertion function from dx to lx. qxtodx Convertion function from qx to dx. dxtoqx Convertion function from dx to qx. qxtomx Convertion function from qx to mx. mxtoqx Convertion function from mx to qx. qxtolx Convertion function from qx to lx. lxtoqx Convertion function from lx to qx. uxtoqx μ(x)を返すGompertz-Makehamモデルを,生命表データに当てはめるためにqxに変換する Converting μ(x), mainly returned by Gompertz-Makeham model function GompertzMakeham(), into qx for fitting with lifetable data. lifetable mxが与えられると生命表全体を計算しデータフレームとして返す For given mx, calculating the whole lifetable and return it as a dataframe. lifetable2 mxが与えられると生命表全体を計算しデータフレームとして返す。axやnの柔軟な与え方が可能。 For given mx, calculating the whole lifetable and return it as a dataframe. It's possible to specify irregular ax and n. lifetable3 lxが与えられると生命表全体を計算しデータフレームとして返す For given mx, calculating the whole lifetable and return it as a dataframe. clifetable qxが与えられると生命表全体を計算しデータフレームとして返す For given qx, calculating the whole lifetable and return it as a dataframe. 補足的な計算のためのツール群(Tools for supplemental calculation) 非常にプリミティブなものもあるが,もしかすると役に立つかもしれないツール群 Some of the functions listed below may be very primitive, but there may be somewhat usefulness. CronbachAlpha 尺度の信頼性係数の1つであるクロンバックのα係数を計算する Calculate Cronbach's alpha coefficient. geary.test 尖度に注目した分布の正規性の検定の1つであるギアリーの検定を実行する Geary's test for normality about kurtosis. Kappa.test 一致度についてのコーエンのカッパ係数を計算し,その簡易評価を提示し,統計学的有意性を検定する Calculate Cohen's kappa statistics for agreement NagelkerkeR2 ロジスティック回帰分析でモデルの説明力を示すのによく使われる,NagelkerkeのR2を計算する Calculate Nagelkerke's R squared. oddsratio オッズ比と信頼区間を計算する Calculate odds ratio and its confidence intervals pairwise.fisher.test 比率の差についての多重比較をする目的で,pairwise.prop.test()のカイ二乗検定の代わりにFisherの直接確率検定を使うようにした関数 Exact version of pairwise.prop.test percentile 数値ベクトルをパーセンタイル値に変換する Convert numeric vector into its percentile ratedifference 率差と信頼区間を計算する Calculate incidence rate difference and its confidence intervals rateratio 率比と信頼区間を計算する Calculate incidence rate ratio and its confidence intervals print.roc ROC分析の結果としてのrocクラスオブジェクトをコンソールに表示する Calculate Receiver Operating Characteristic (ROC) curve riskdifference リスク差と信頼区間を計算する Calculate risk difference and its confidence intervals riskratio リスク比と信頼区間を計算する Calculate risk ratio and its confidence intervals roc ROC分析を行い,結果をrocクラスのオブジェクトとして返す Calculate Receiver Operating Characteristic (ROC) curve SIQR fivenum()関数に基づき四分位偏差(SIQR)を計算する。Rに入っているIQR()関数はquantile()関数を使うので,結果が異なる Calculate semi-interquartile range truemedian 同順位がある場合にGrimm (1993)に説明されている真の中央値を計算するための関数 Calculate true median for data with ties. VIF 多重共線性のチェックのため,VIFを計算する Calculate variance inflation factor (VIF) from the result of lm. }}}