| Type: | Package | 
| Title: | Desirable Dietary Pattern | 
| Version: | 0.0.3 | 
| Date: | 2021-05-08 | 
| Description: | The desirable Dietary Pattern (DDP)/ PPH score measures the variety of food consumption. The (weighted) score is calculated based on the type of food. This package is intended to calculate the DDP/ PPH score that is faster than traditional method via a manual calculation by BKP (2017) http://bkp.pertanian.go.id/storage/app/uploads/public/5bf/ca9/06b/5bfca906bc654274163456.pdf and is simpler than the nutrition survey http://www.nutrisurvey.de. The database to create weights and baseline values is the Indonesia national survey in 2017. | 
| Depends: | R (≥ 2.10) | 
| License: | GPL-3 | 
| LazyData: | TRUE | 
| RoxygenNote: | 7.1.1 | 
| Suggests: | knitr, rmarkdown | 
| VignetteBuilder: | knitr | 
| NeedsCompilation: | no | 
| Packaged: | 2021-05-08 14:46:09 UTC; Weksi Budiaji | 
| Author: | Weksi Budiaji [aut, cre] | 
| Maintainer: | Weksi Budiaji <budiaji@untirta.ac.id> | 
| Repository: | CRAN | 
| Date/Publication: | 2021-05-08 15:30:02 UTC | 
Calory calculation
Description
This function calculates the total calory of each responden.
Usage
kalori(data, output = "all")
Arguments
| data | A data set of (n x 218) (see Details). | 
| output | A desirable output, the default is "all" (see Details). | 
Details
The data set is an n x 218 data frame. The first column is
the name of the respondent. The rest columns are types of food. The type of
food can be listed as in the data simulation (see in the data example
of simulasi or vignette("ddp")).
The output argument has "all" as the 
default, meaning that all of the calories are yielded. They are
energy, protein, fat, and carbohydrate. Single calory can be produced
by writing the output argument with "protein" for the calory of protein,
for example. The possible inputs for output argument are
"all", "energi", "protein", "lemak" for fat, and "karbohidrat".
Value
Function returns a matrix of n x 4 for "all" and n x 1 for other "output" arguments.
Author(s)
Weksi Budiaji 
 Contact: budiaji@untirta.ac.id
References
BKP, Kementan. 2017. Aplikasi Harmonisasi Analisis PPH Data Susenas 2017. Badan Ketahanan Pangan Kementrian Pertanian.
Examples
#data simulation of 10 person
set.seed(2020)
n <- 10
matsim <- matrix(0, n, 218)
datsim <- as.data.frame(matsim)
datsim$V1 <- LETTERS[1:n]
#calory for boiled rice
datsim$V2 <- rnorm(n, 200, 50)
#calory for boiled egg
datsim$V73 <- rnorm(n, 60, 5)
#calory for fresh milk
datsim$V79 <- rnorm(n, 100, 10)
#calory for tomato
datsim$V93 <- rnorm(n, 19, 2)
#caloty for pineapple
datsim$V134 <- rnorm(n, 20, 2)
kalori(datsim)
Simulation data
Description
A dataset containing 218 columns and 5 rows. The first column is the name of the respondents, while the rest is the type of food. The type of food is expalined in Indonesian. The simulation data set is a family data set with 5 members. They eat rice (nasi) in a particular weight (in gram), cat fish, spinach (bayam), and banana (pisang lainnya). Three family members drink milk powder. Thus, the data have values in column 1, 28, 81, 85, and 135 only.
Usage
simulasi
Format
A data frame with 5 rows and 218 columns:
- Nama
- The name of respondents 
- X1
- Beras:beras lokal, kualitas unggul, impor 
- X2
- Beras ketan 
- X3
- Jagung basah dengan kulit 
- X4
- Jagung pipilan/beras jagung 
- X5
- Tepung beras 
- X6
- Tepung jagung:maizena 
- X7
- Tepung terigu 
- X8
- Padi-padian lainnya 
- X9
- Ketela pohon/singkong 
- X10
- Ketela rambat/ubi jalar 
- X11
- Sagu:bukan dari ketela pohon 
- X12
- Talas/keladi 
- X13
- Kentang 
- X14
- Gaplek 
- X15
- Tepung Gaplek: tiwul 
- X16
- Tepung ketela pohon: tapioka/kanji 
- X17
- Umbi-umbian lainnya 
- X18
- Ekor kuning segar 
- X19
- Tongkol/tuna/cakalang segar 
- X20
- Tenggiri segar 
- X21
- Selar segar 
- X22
- Kembung segar 
- X23
- Teri segar 
- X24
- Bandeng segar 
- X25
- Gabus segar 
- X26
- Mujair/Nila segar 
- X27
- Mas segar 
- X28
- lele segar 
- X29
- Kakap segar 
- X30
- Baronang segar 
- X31
- Patin segar 
- X32
- Bawalsegar 
- X33
- Gurame segar 
- X34
- Ikan segar/basah lainnya 
- X35
- Udang segar 
- X36
- Cumi-cumi/sotong segar 
- X37
- Ketam/kepiting/rajungan segar 
- X38
- Kerang/siput segar 
- X39
- Udang dan hewan air lainnya yang segar lainnya 
- X40
- Kembung diawetkan/peda 
- X41
- Tenggiri diawetkan 
- X42
- Tongkol/tuna/cakalang diawetkan 
- X43
- Teri diawetkan 
- X44
- Selar diawetkan 
- X45
- Sepat diawetkan 
- X46
- Bandeng diawetkan 
- X47
- Gabus diawetkan 
- X48
- Ikan dalam kaleng 
- X49
- Ikan diawetkan lainnya 
- X50
- Udang: ebi, rebon diawetkan 
- X51
- Cumi-cumi/sotong diawetkan 
- X52
- Udang dan hewan air lainnya yang diawetkan 
- X53
- Daging sapi segar 
- X54
- Daging kerbau segar 
- X55
- Daging kambing segar 
- X56
- Daging babi segar 
- X57
- Daging ayam ras segar 
- X58
- Daging ayam kampung segar 
- X59
- Daging bebek/itik segar 
- X60
- Daging unggas segar lainnya 
- X61
- Daging segar lainnya 
- X62
- Dendeng 
- X63
- Abon: sapi, ayam, rusa, dsb 
- X64
- Daging dalam kaleng: kornet, dsb 
- X65
- Sosis, nuget, daging asap, bakso diawetkan 
- X66
- Daging diawetkan lainnya 
- X67
- Hati 
- X68
- Jeroan: usus, paru, limpa, babat, ampela, dsb 
- X69
- Tetelan 
- X70
- Tulang 
- X71
- Kategori daging lainnya selain dari 53 s.d 70 
- X72
- Telur ayam ras 
- X73
- Telur ayam kampung 
- X74
- Telur itik/manila 
- X75
- Telur puyuh 
- X76
- Telur lainnya 
- X77
- Telur asin 
- X78
- Susu murni 
- X79
- Susu cair pabrik 
- X80
- Susu kental manis 
- X81
- Susu bubuk 
- X82
- Susu bubuk bayi 
- X83
- Keju 
- X84
- Hasil lain dari susu 
- X85
- Bayam 
- X86
- Kangkung 
- X87
- Kol/kubis 
- X88
- Sawi putih/ petsai 
- X89
- Sawi hijau 
- X90
- Buncis 
- X91
- Kacang panjang 
- X92
- Tomat sayur 
- X93
- Wortel 
- X94
- Mentimun 
- X95
- Daun ketela pohon/ daun singkong 
- X96
- Terung 
- X97
- Tauge 
- X98
- Labu 
- X99
- Jagung muda 
- X100
- Bahan sayur sop/ cap cay 
- X101
- Bahan sayur asem/ lodeh 
- X102
- Nangka muda 
- X103
- Pepaya muda 
- X104
- Jamur 
- X105
- Petai 
- X106
- Jengkol 
- X107
- Bawang merah 
- X108
- Bawang putih 
- X109
- Cabe merah 
- X110
- Cabe hijau 
- X111
- Cabe rawit 
- X112
- Sayur dalam kaleng 
- X113
- Sayur-sayuran lainnya 
- X114
- Kacang tanah tanpa kulit 
- X115
- Kacang tanah dengan kulit 
- X116
- Kacang kedelai 
- X117
- Kacang hijau 
- X118
- Kacang mede 
- X119
- Kacang lainnya 
- X120
- Tahu 
- X121
- Tempe 
- X122
- Tauco 
- X123
- Oncom 
- X124
- Hasil lain dari kacang-kacangan 
- X125
- Jeruk 
- X126
- Mangga 
- X127
- Apel 
- X128
- Alpokat 
- X129
- Rambutan 
- X130
- Duku 
- X131
- Durian 
- X132
- Salak 
- X133
- Nanas 
- X134
- Pisang ambon 
- X135
- Pisang lainnya 
- X136
- Pepaya 
- X137
- Jambu 
- X138
- Sawo 
- X139
- Belimbing 
- X140
- Kedondong 
- X141
- Semangka 
- X142
- Melon 
- X143
- Nangka 
- X144
- Tomat buah 
- X145
- Buah dalam kaleng 
- X146
- Buah-buahan lainnya 
- X147
- Minyak kelapa 
- X148
- Minyak jagung 
- X149
- Minyak goreng 
- X150
- Kelapa 
- X151
- Margin 
- X152
- Minyak dan kelapa lainnya 
- X153
- Gula pasir 
- X154
- Gula merah/ gula cair 
- X155
- Teh bubuk 
- X156
- Teh celup: sachet 
- X157
- Kopi: bubuk, biji 
- X158
- Kopi instan: sachet 
- X159
- Coklat instan 
- X160
- Coklat bubuk 
- X161
- Sirup 
- X162
- Bahan minuman lainnya 
- X163
- Garam 
- X164
- Kemiri 
- X165
- Ketumbar/ jinten 
- X166
- Merica/ lada 
- X167
- Asam 
- X168
- Terasi/ petis 
- X169
- Kecap 
- X170
- Penyedap masakan/ vetsin 
- X171
- Sambal jadi 
- X172
- Saos tomat 
- X173
- Bumbu masak jadi/ kemasan 
- X174
- Bumbu dapur lainnya: pala, jahe, kunyit, dsb 
- X175
- Mie instan 
- X176
- Mie basah 
- X177
- Bihun 
- X178
- Makaroni/ mie kering 
- X179
- Kerupuk 
- X180
- Emping 
- X181
- Bahan agar-agar 
- X182
- Bubur bayi kemasan 
- X183
- Konsumsi lainnya selain nomor 175 s.d 182 
- X184
- Roti tawar 
- X185
- Roti manis/ lainnya 
- X186
- Kue kering/ biskuit 
- X187
- Kue basah 
- X188
- Makanan gorengan 
- X189
- Bubur kacang hijau 
- X190
- Gado-gado/ ketoprak/ pecel 
- X191
- Nasi campur/ rames 
- X192
- Nasi goreng 
- X193
- Nasi putih 
- X194
- Lontong/ ketupat sayur 
- X195
- Soto/ gulai/ sop/ rawon/ cincang 
- X196
- Sayur matang 
- X197
- Sate/ tongseng 
- X198
- Mie bakso/ rebus/ goreng 
- X199
- Mie instan makanan jadi 
- X200
- Makanan ringan anak-anak 
- X201
- Ikan matang 
- X202
- Ayam/ daging matang 
- X203
- Daging olahan matang 
- X204
- Bubur ayam 
- X205
- Siomay/ batagor 
- X206
- Makanan jadi lainnya 
- X207
- Air kemasan 
- X208
- Air kemasan galon 
- X209
- Air teh kemasan 
- X210
- Saribuah kemasan 
- X211
- Minuman ringan C02: soda 
- X212
- Minuman kesahatan/ energi 
- X213
- Minuman jadi: kopi, susu, teh, susu coklat, dsb 
- X214
- Es krim 
- X215
- Es lainnya 
- X216
- Bir 
- X217
- Minuman beralkohol lainnya 
Desirable dietary pattern calculation
Description
This function calculates the desirable dietary pattern (DDP).
Usage
skorpph(data, wilayah = "Indonesia", baseline = 2000)
Arguments
| data | A data set of (n x 218) (see Details). | 
| wilayah | An origin of the responden residence. (see Details). | 
| baseline | A baseline value of personal calory required. | 
Details
The data set is an n x 218 data frame. The first column is
the name of the respondent. wilayah argument has "Indonesia" as the 
default, meaning that the DPP are calculated based on the national (Indonesia)
baseline. The other possible inputs for wilayah are "Aceh", "Sumut",
"Sumbar", "Riau", "KepRiau", "Jambi", "Sumsel", "Babel", "Bengkulu",
"Lampung", "Jakarta", "Jabar", "Banten", "Jateng", "DIY", "Jatim", "Bali",
"NTB", "NTT", "Kalbar", "Kalteng", "Kalsel", "Kaltim", "Kalut", "Sulut",
"Sulteng", "Sultra", "Sulsel", "Gorontalo", "Sulbar", "Maluku", "Malut",
"Papua", "Papbar". For baseline argument, it is 2000 as the default 
value because the minimal calory required in Indonesia is 2000 calory.
Value
Function returns a vector with n length indicates the index/ indices of the DDP per peson.
Author(s)
Weksi Budiaji 
 Contact: budiaji@untirta.ac.id
References
BKP, Kementan. 2017. Aplikasi Harmonisasi Analisis PPH Data Susenas 2017. Badan Ketahanan Pangan Kementrian Pertanian.
Examples
#data simulation of 10 person
set.seed(2020)
n <- 10
matsim <- matrix(0, n, 218)
datsim <- as.data.frame(matsim)
datsim$V1 <- LETTERS[1:n]
#calory for boiled rice
datsim$V2 <- rnorm(n, 200, 50)
#calory for boiled egg
datsim$V73 <- rnorm(n, 60, 5)
#calory for fresh milk
datsim$V79 <- rnorm(n, 100, 10)
#calory for tomato
datsim$V93 <- rnorm(n, 19, 2)
#caloty for pineapple
datsim$V134 <- rnorm(n, 20, 2)
skorpph(datsim)
Validity and Reliability check.
Description
This function calculates the item-rest correlation.
Usage
valid(data, alpha = 0.05, total = NULL)
Arguments
| data | A data set/ matrix (see Details). | 
| alpha | An alpha value (see Details). | 
| total | A single numeric value of the index column (see Details). | 
Details
The data set is a data frame/ matrix n x k. The row is
the name of the respondent as many as n, while the column is 
the variables (k). The alpha value is set between 0.0001 and 
0.20, the default is 0.05. If the total input is NULL,
it means that the total score will be calculated first, 
the column index of the total score can be also stated otherwise.
The index of the column is a numeric value with a length of one.
It has to be between 1 and (k).
Value
Function returns a data frame with k row and four columns. the columns indicate the item-rest correlation, correlation threshold, p value, and validity and reliability conclusion.
Author(s)
Weksi Budiaji 
 Contact: budiaji@untirta.ac.id
Examples
#data simulation of 10 person 5 variables
set.seed(1)
dat <- matrix(sample(1:7,10*5, replace = TRUE), 10,5)
valid(dat)