So I am relatively new to stata and I need to find the power function for a two-sided test for which the lambda value <=4.
input spec
0.5
0.7
0.9
end
generate a1 = runiform()
generate a2 = -3.3<=a1<=4.7
generate lambda = a2<=4
scalar n=3
scalar si=0.2
twoway function y=normal((sqrt(n)*(lambda)/si ///
-invnormal(0.975)) + (sqrt(n)*(lambda)/si ///
-invnormal(0.975))), range(0.5 0.9) ///
title ("Power function") ytitle("power") ///
yline (0 0.05 1, lp(dash) lc(gs1))
This is the programme that I have been trying to execute but the last part from the two-way graph is creating problems. Everytime I try to run it, it shows r100 parenthesis needed. Can someone please help me out and tell me where am I going wrong in the last part where I need to plot the graph for the power function.
Related Posts with Power function analysis
duplicates tag in a foreach loopHello everyone. I am trying to make this loop run but it keeps on giving me { required r(100). I am…
How to deal with error correlation model with Stataregression function is : Array Array In the following data, variable value is the value of 1952,…
Generating time series dummy for a pooled panel dataHi I am trying to estimate time series models for 13 different brand's on their sales and promotion…
Failure of anaconda / miniconda python in Stata 16.1 for macOSI have set up miniconda3 python 3.7 with various packages on macOS 10.15.3. For a project, I want to…
[Beginner question] Bayesian Hierarchical ModelDear everyone, I'm trying to replicate a Bayesian model similar to one found on page 47-51 of this …
Subscribe to:
Post Comments (Atom)
0 Response to Power function analysis
Post a Comment