[R] Is there any design based two proportions z test?

2024-01-16 Thread Md. Kamruzzaman
Hello Everyone,
I was analysing big survey data using survey packages on RStudio. Survey
package allows survey data analysis with the design effect.The survey
package included functions for all other statistical analysis except
two-proportion z tests.

I was trying to calculate the difference in prevalence of Diabetes and
Prediabetes between the year 2011 and 2017 (with 95%CI). I was able to
calculate the weighted prevalence of diabetes and prediabetes in the Year
2011 and 2017 and just subtracted the prevalence of 2011 from the
prevalence of 2017 to get the difference in prevalence. But I could not
calculate the 95%CI of the difference in prevalence considering the weight
of the survey data.

I was also trying to see if this difference in prevalence is statistically
significant. I could do it using the simple two-proportion z test without
considering the weight of the sample. But I want to do it considering the
weight of the sample.


Example: Prevalence of Diabetes:
 2011: 11.0 (95%CI
10.1-11.9)
 2017: 10.1 (95%CI
9.4-10.9)
 Diff: 0.9% (95%CI: ??)
 Proportion Z test P
Value: ??
Your cooperation will be highly appreciated.

Thanks in advance.

With Regards

**

*Md Kamruzzaman*

*PhD **Research Fellow (**Medicine**)*
Discipline of Medicine and Centre of Research Excellence in Translating
Nutritional Science to Good Health
Adelaide Medical School | Faculty of Health and Medical Sciences
The University of Adelaide
Adelaide SA 5005

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] I need to create new variables based on two numeric variables and one dichotomize conditional category variables.

2023-11-04 Thread Md. Kamruzzaman
Thanks Everyone,
My variables are in a dataframe with multiple other variables.

Thanks

-

*Md Kamruzzaman*


On Sat, Nov 4, 2023 at 1:13 AM Bert Gunter  wrote:

> Well, something like:
>
> LAP <- ifelse(gender =='male', (WC-65)*TG, (WC-58)*TG)
>
> The exact code depends on whether your variables are in a data frame or
> list or whatever, which you failed to specify. If so, ?with  may be useful.
>
> Cheers,
> Bert
>
>
>
> On Fri, Nov 3, 2023 at 3:43 AM Md. Kamruzzaman 
> wrote:
>
>> Hello Everyone,
>> I have three variables: Waist circumference (WC), serum triglyceride (TG)
>> level and gender. Waist circumference and serum triglyceride is numeric
>> and
>> gender (male and female) is categorical. From these three variables, I
>> want
>> to calculate the "Lipid Accumulation Product (LAP) Index". The equation to
>> calculate LAP is different for male and females. I am giving both
>> equations
>> below.
>>
>> LAP for male = (WC-65)*TG
>> LAP for female = (WC-58)*TG
>>
>> My question is 'how can I calculate the LAP and create a single new
>> column?
>>
>> Your cooperation will be highly appreciated.
>>
>> Thanks in advance.
>>
>> With Regards
>>
>> **
>>
>> *Md Kamruzzaman*
>>
>> *PhD **Research Fellow (**Medicine**)*
>> Discipline of Medicine and Centre of Research Excellence in Translating
>> Nutritional Science to Good Health
>> Adelaide Medical School | Faculty of Health and Medical Sciences
>> The University of Adelaide
>> Adelaide SA 5005
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] I need to create new variables based on two numeric variables and one dichotomize conditional category variables.

2023-11-03 Thread Md. Kamruzzaman
Hello Everyone,
I have three variables: Waist circumference (WC), serum triglyceride (TG)
level and gender. Waist circumference and serum triglyceride is numeric and
gender (male and female) is categorical. From these three variables, I want
to calculate the "Lipid Accumulation Product (LAP) Index". The equation to
calculate LAP is different for male and females. I am giving both equations
below.

LAP for male = (WC-65)*TG
LAP for female = (WC-58)*TG

My question is 'how can I calculate the LAP and create a single new column?

Your cooperation will be highly appreciated.

Thanks in advance.

With Regards

*----*

*Md Kamruzzaman*

*PhD **Research Fellow (**Medicine**)*
Discipline of Medicine and Centre of Research Excellence in Translating
Nutritional Science to Good Health
Adelaide Medical School | Faculty of Health and Medical Sciences
The University of Adelaide
Adelaide SA 5005

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.