Title: | Desirable Dietary Pattern |
---|---|
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. |
Authors: | Weksi Budiaji [aut, cre] |
Maintainer: | Weksi Budiaji <[email protected]> |
License: | GPL-3 |
Version: | 0.0.3 |
Built: | 2024-11-15 04:06:05 UTC |
Source: | https://github.com/cran/ddp |
This function calculates the total calory of each responden.
kalori(data, output = "all")
kalori(data, output = "all")
data |
A data set of (n x 218) (see Details). |
output |
A desirable output, the default is "all" (see 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".
Function returns a matrix of n x 4 for "all" and n x 1 for other "output" arguments.
Weksi Budiaji
Contact: [email protected]
BKP, Kementan. 2017. Aplikasi Harmonisasi Analisis PPH Data Susenas 2017. Badan Ketahanan Pangan Kementrian Pertanian.
#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)
#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)
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.
simulasi
simulasi
A data frame with 5 rows and 218 columns:
The name of respondents
Beras:beras lokal, kualitas unggul, impor
Beras ketan
Jagung basah dengan kulit
Jagung pipilan/beras jagung
Tepung beras
Tepung jagung:maizena
Tepung terigu
Padi-padian lainnya
Ketela pohon/singkong
Ketela rambat/ubi jalar
Sagu:bukan dari ketela pohon
Talas/keladi
Kentang
Gaplek
Tepung Gaplek: tiwul
Tepung ketela pohon: tapioka/kanji
Umbi-umbian lainnya
Ekor kuning segar
Tongkol/tuna/cakalang segar
Tenggiri segar
Selar segar
Kembung segar
Teri segar
Bandeng segar
Gabus segar
Mujair/Nila segar
Mas segar
lele segar
Kakap segar
Baronang segar
Patin segar
Bawalsegar
Gurame segar
Ikan segar/basah lainnya
Udang segar
Cumi-cumi/sotong segar
Ketam/kepiting/rajungan segar
Kerang/siput segar
Udang dan hewan air lainnya yang segar lainnya
Kembung diawetkan/peda
Tenggiri diawetkan
Tongkol/tuna/cakalang diawetkan
Teri diawetkan
Selar diawetkan
Sepat diawetkan
Bandeng diawetkan
Gabus diawetkan
Ikan dalam kaleng
Ikan diawetkan lainnya
Udang: ebi, rebon diawetkan
Cumi-cumi/sotong diawetkan
Udang dan hewan air lainnya yang diawetkan
Daging sapi segar
Daging kerbau segar
Daging kambing segar
Daging babi segar
Daging ayam ras segar
Daging ayam kampung segar
Daging bebek/itik segar
Daging unggas segar lainnya
Daging segar lainnya
Dendeng
Abon: sapi, ayam, rusa, dsb
Daging dalam kaleng: kornet, dsb
Sosis, nuget, daging asap, bakso diawetkan
Daging diawetkan lainnya
Hati
Jeroan: usus, paru, limpa, babat, ampela, dsb
Tetelan
Tulang
Kategori daging lainnya selain dari 53 s.d 70
Telur ayam ras
Telur ayam kampung
Telur itik/manila
Telur puyuh
Telur lainnya
Telur asin
Susu murni
Susu cair pabrik
Susu kental manis
Susu bubuk
Susu bubuk bayi
Keju
Hasil lain dari susu
Bayam
Kangkung
Kol/kubis
Sawi putih/ petsai
Sawi hijau
Buncis
Kacang panjang
Tomat sayur
Wortel
Mentimun
Daun ketela pohon/ daun singkong
Terung
Tauge
Labu
Jagung muda
Bahan sayur sop/ cap cay
Bahan sayur asem/ lodeh
Nangka muda
Pepaya muda
Jamur
Petai
Jengkol
Bawang merah
Bawang putih
Cabe merah
Cabe hijau
Cabe rawit
Sayur dalam kaleng
Sayur-sayuran lainnya
Kacang tanah tanpa kulit
Kacang tanah dengan kulit
Kacang kedelai
Kacang hijau
Kacang mede
Kacang lainnya
Tahu
Tempe
Tauco
Oncom
Hasil lain dari kacang-kacangan
Jeruk
Mangga
Apel
Alpokat
Rambutan
Duku
Durian
Salak
Nanas
Pisang ambon
Pisang lainnya
Pepaya
Jambu
Sawo
Belimbing
Kedondong
Semangka
Melon
Nangka
Tomat buah
Buah dalam kaleng
Buah-buahan lainnya
Minyak kelapa
Minyak jagung
Minyak goreng
Kelapa
Margin
Minyak dan kelapa lainnya
Gula pasir
Gula merah/ gula cair
Teh bubuk
Teh celup: sachet
Kopi: bubuk, biji
Kopi instan: sachet
Coklat instan
Coklat bubuk
Sirup
Bahan minuman lainnya
Garam
Kemiri
Ketumbar/ jinten
Merica/ lada
Asam
Terasi/ petis
Kecap
Penyedap masakan/ vetsin
Sambal jadi
Saos tomat
Bumbu masak jadi/ kemasan
Bumbu dapur lainnya: pala, jahe, kunyit, dsb
Mie instan
Mie basah
Bihun
Makaroni/ mie kering
Kerupuk
Emping
Bahan agar-agar
Bubur bayi kemasan
Konsumsi lainnya selain nomor 175 s.d 182
Roti tawar
Roti manis/ lainnya
Kue kering/ biskuit
Kue basah
Makanan gorengan
Bubur kacang hijau
Gado-gado/ ketoprak/ pecel
Nasi campur/ rames
Nasi goreng
Nasi putih
Lontong/ ketupat sayur
Soto/ gulai/ sop/ rawon/ cincang
Sayur matang
Sate/ tongseng
Mie bakso/ rebus/ goreng
Mie instan makanan jadi
Makanan ringan anak-anak
Ikan matang
Ayam/ daging matang
Daging olahan matang
Bubur ayam
Siomay/ batagor
Makanan jadi lainnya
Air kemasan
Air kemasan galon
Air teh kemasan
Saribuah kemasan
Minuman ringan C02: soda
Minuman kesahatan/ energi
Minuman jadi: kopi, susu, teh, susu coklat, dsb
Es krim
Es lainnya
Bir
Minuman beralkohol lainnya
This function calculates the desirable dietary pattern (DDP).
skorpph(data, wilayah = "Indonesia", baseline = 2000)
skorpph(data, wilayah = "Indonesia", baseline = 2000)
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. |
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.
Function returns a vector with n length indicates the index/ indices of the DDP per peson.
Weksi Budiaji
Contact: [email protected]
BKP, Kementan. 2017. Aplikasi Harmonisasi Analisis PPH Data Susenas 2017. Badan Ketahanan Pangan Kementrian Pertanian.
#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)
#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)
This function calculates the item-rest correlation.
valid(data, alpha = 0.05, total = NULL)
valid(data, alpha = 0.05, total = NULL)
data |
A data set/ matrix (see Details). |
alpha |
An alpha value (see Details). |
total |
A single numeric value of the index column (see 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).
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.
Weksi Budiaji
Contact: [email protected]
#data simulation of 10 person 5 variables set.seed(1) dat <- matrix(sample(1:7,10*5, replace = TRUE), 10,5) valid(dat)
#data simulation of 10 person 5 variables set.seed(1) dat <- matrix(sample(1:7,10*5, replace = TRUE), 10,5) valid(dat)