Skip to main content

Sample Size Calculation for Questionnaires using R


 

To calculate sample size for a questionnaire study, you will need to consider a few factors:

  1. The type of statistical test you will be using: Different statistical tests have different assumptions and requirements, so you will need to choose a test that is appropriate for your data and research question.

  2. The desired level of precision: The sample size should be large enough to provide the desired level of precision in your estimates. For example, if you want to be able to detect small differences between groups, you will need a larger sample size than if you are only interested in detecting large differences.

  3. The expected response rate: The sample size should be large enough to account for the expected response rate. If you expect a low response rate, you will need a larger sample size to ensure that you have sufficient data for your analysis.

  4. The population size: If the population is small, you may need a larger sample size to ensure that your sample is representative of the population.

    If you plan to use structural equation modeling (SEM) for your analysis, you will need to consider the number of indicators (measured variables) and the number of latent variables (unmeasured variables) in your model when calculating sample size. The sample size required for SEM will depend on the complexity of the model, the level of precision you desire, and the expected level of measurement error in your data.

    There are several ways to calculate sample size for SEM in R, but one approach is to use the power.sem function from the lavaan package. This function calculates the sample size needed to achieve a specified power level for a given SEM model, based on the number of indicators and latent variables in the model, the desired level of precision, and the expected level of measurement error.

    Here is an example of how to use the power.sem function to calculate sample size for an SEM model with one latent variable and 10 indicators:

 # Load the lavaan package
library(lavaan)

# Set the desired power level (e.g. 0.8)
power = 0.8

# Set the desired alpha level (e.g. 0.05)
alpha = 0.05

# Set the number of indicators in the model (e.g. 10)
indicators = 10

# Set the number of latent variables in the model (e.g. 1)
latents = 1

# Set the expected level of measurement error (e.g. 0.5)
me = 0.5

# Calculate the sample size
n = power.sem(indicators = indicators, latents = latents, power = power, alpha = alpha, me = me)$n

# Print the sample size
print(n)


    This code will calculate the sample size needed to achieve a power of power for a SEM model with indicators indicators and latents latent variables, with an alpha level of alpha and an expected level of measurement error of me.

Popular posts from this blog

G*Power Perisian Bagi Pengiraan Sampel Saiz.

Penggunaan Gpower kerap menekan kepada tiga langkah berikut: Memilih ujian statistik yang sesuai atau padan dengan masalah yang di kaji. Memilih di antara lima jenis analisis kuasa (power analysis) yang di sediakan. Sediakan parameter input yang di perlukan analasis dan klik pada “calculate” Pada Langkah 1, pendekatan yang digunakan untuk memilih ujian statistic (statistical test) adalah melalui dua pendekatan, iaitu distribution based atau design-based approach . Distribution-based approach to the test selection Melalui pendekatan distribution-based , pendekatan pertama adalah melihat pada kumpulan umum ujian statistik menggunakan '' Test family'' menu yang terdapat di window atau tingkap utama.   Ujian statitik ( Statistical test ) menu akan berubah mengikut pilihan di dalam '' Test family'' . Ujian-ujian yang ada akan selaras mengikut pada '' test family'' yang di pilih sahaja. Design-based approach to the test se

Ujian Analisa Sehala MANOVA

Perbezaan analisa ini dengan ANOVA adalah pembolehubah bersandarnya mempunyai lebih daripada satu . Manakala, pembolehubah bebas adalah sama seperti ANOVA yang mempunyai pelbagai kumpulan. Analisa sehala MANOVA juga mempunyai sarat ujian statistik di dalamnya dan tidak dapat memberi maklumat secara spesifik kumpulan yang berbeza signifikan di antara satu sama lain. Ujian ini hanya akan memberi maklumat sekurang-kurang dua kumpulan adalah berbeza. Oleh sebab, kebiasaan penggunaan analisa ini oleh pengkaji akan melibatkan tiga, empat atau lebih kumpulan. Oleh itu penggunaan ujian post-hoc adalah penting untuk mengetahui perbezaan kumpulan selebihnya itu. Bagi mendapat analisa yang sah dan berkualiti, beberapa andaian perlu di penuhi dahulu sebelum menggunakan analisa MANOVA. Pembolehubah bersandar mestilah dalam skala selang atau nisbah. Pembolehubah bebas a.k.a pembolehubah tidak bersandar mestilah mempunyai beberapa kumpulan yang bebas atau dengan kata lain dalam skala ordina

ANOVA vs MANOVA

Perbezaan utama di antara ANOVA dan MANOVA adalah jumlah bilangan pembolehubah bersandar ( dependent variable ). Walaupun begitu, jika terdapat pembolehubah bersandar lebih daripada satu, masih bukan masalah dan merupakan pilihan lain jika pengkaji mahu untuk menguji secara berasingan menggunakan analisa ANOVA bagi setiap pembolehubah bersandar itu. Jadi, kenapa perlu menggunakan pengiraan MANOVA ini berbanding beberapa analisa menggunakan ANOVA jika terdapat pembolehubah bersandar yang lebih daripada satu seperti dua, tiga atau empat pembolehubah bersandar? Terdapat dua sebab utama, MANOVA berpotensi menggantikan ANOVA dalam beberapa keadaan. Pertama melibatkan teori yang logik dan kedua melibatkan statistiknya. Sebagai contoh: Skormatematik + skorfizik + skorkimia sebagai fungsi kepada ( as a function of ) minuman tambahan ( tiga tahap / level ) Minuman tambahan, pembolehubah tidak bersandar atau bebas dengan tiga tahap ( levels ) : minuman kurma, minuman madu dan minuma