SAS t-test for proportions

data kaz;

N_yes=1162;
N_no=381;

mean_yes=0.129088;
mean_no=0.170604;

DEG_FD=N_Yes + N_No -2;
/*QC’ed
tValue=2.228;
DEG_FD=10;
*/

tValue=(Mean_NO-Mean_Yes)/(SQRT((Mean_NO*(1-Mean_NO) /
N_No )+Mean_Yes*(1-Mean_Yes)/ N_Yes));

/*2 tail test*/
P_value=(1-probt(abs(tValue),DEG_FD))*2;
run;

<?php

function compute()
{

$roundunit=3;

$Tmean = $_POST['Tmean'];
$Cmean = $_POST['Cmean'];
$TSD = $_POST['TSD'];
$CSD = $_POST['CSD'];
$TN = $_POST['TN'];
$CN = $_POST['CN'];

$mean_dif=$Tmean-$Cmean;
$SE=sqrt(
(($TSD*$TSD) / $TN)+(($CSD*$CSD) / $CN)
);

$T=$mean_dif/$SE;
$DF=$TN+$CN-2;

$P="Under Development (Still working on this)";

/*I will get T for binary variable comparison*/
$N_SUCCESS_T=$TN*$Tmean;
$N_SUCCESS_C=$CN*$Cmean;
$P_=($N_SUCCESS_T+$N_SUCCESS_C)/($TN+$CN);
$Z_numerator=$Tmean-$Cmean-0;
$Z_denom=SQRT(($P_*(1-$P_))*((1/$TN)+(1/$CN)));
$Z_bin=abs($Z_numerator/$Z_denom);
$Z_bin_abs=abs($Z_numerator/$Z_denom);

/*$P=stats_dens_normal($T, 0,1);*/
/*$P=stats_dens_gamma(float $X, float $shape, float $scale);*/
/*$P= $T / 100 ;*/

/*Hedges g*/
/*g numerator*/
$g_numerator=($Tmean-$Cmean)*(1-3/((4*($TN+$CN))-9));
/*g demnominator*/
$g_denominator=SQRT(((($TN-1)* ($TSD**2) )+(($CN-1)* ($CSD**2) ))/($TN+$CN-2));
$hedges_d=$g_numerator/$g_denominator;
$hedges_d_abs=abs($hedges_d);

/*if binary variabels*/
$T_Odds=$Tmean/(1-$Tmean);
$C_Odds=$Cmean/(1-$Cmean);
$Odds_ratio=$T_Odds/$C_Odds;
$Tstep1=log($T_Odds);
$Cstep1=log($C_Odds);
$step2=$Tstep1-$Cstep1;
$WWC_binary_effect=$step2/1.65;

/*
if ($hedges_d >= 0.2) echo "Small Effect (Cohen)";
if ($hedges_d >= 0.5) echo "Medium Effect (Cohen)";
if ($hedges_d >= 0.8) echo "Large Effect (Cohen)";
*/

echo "<br>";
echo "WWC group comparison of continuous and binary variables";
echo "<br>";
echo "<br>";

 

echo "Treatment N:" .$TN;
echo "<br>";

echo "Treatment mean:" .$Tmean;
echo "<br>";
echo "Treatment SD:" .$TSD;

echo "<br>";
echo "<br>";

echo "Comparison N:" .$CN;
echo "<br>";
echo "Comparison mean:" .$Cmean;
echo "<br>";
echo "Comparison SD:" .$CSD;

echo "<br>";
echo "The group mean difference:".round($mean_dif,$roundunit);
echo "<br>";
echo "<br>";

echo "[RESULTS FOR CONTINUOUS OUTCOME]";
echo "<br><br>";
/*echo "Probability " .round($P,2);*/
echo "Probability: " .$P;
echo "<br>";

$abs_T=abs($T);

echo "T-score is: " .round($T,$roundunit);
echo "<br>";

if($abs_T < 1.96 ) {
echo "Not significant at alpha 0.05 (two tail test;I used a z-test and ignored degree of freedom; threshold 1.96)";
}elseif($abs_T >=1.96){
echo "Significant at alpha 0.05 (two tail test;I used a z-test and ignored degree freedom; threshold 1.96)";
}
echo "<br>";
echo "<br>";
echo "T-test (the same test as above but with three thresholds)";
echo "T 1.96, 2.576, 3.291, each for p=0.05, 0.01, 0.001";
echo "<br>";
if($abs_T < 1.96) {
echo "Not sig. at alpha 0.05";
}elseif($abs_T>=1.960 and $abs_T < 2.576 ){
echo "Sig at p=.05*";

}elseif($abs_T>=2.576 and $abs_T < 3.291 ){
echo "Sig at p=.01**";

}elseif($abs_T>=3.291 ){
echo "Sig at p=.001***";
}else {
echo "N/A";
}

 

 

 

 

echo "<br>";
echo "<br>";

echo "Hedges d " .round($hedges_d,$roundunit);

echo "<br>";
/*cohen's rule of thumb*/
echo "Cohen's rule of thumb for effect size interpretation";
echo "<br>";
if($hedges_d_abs < 0.2) {
echo "Close to zero and Not even small Effect (Cohen)";
}elseif($hedges_d_abs>=0.2 and $hedges_d_abs < 0.5){
echo "Small effect (Cohen)";
}elseif($hedges_d_abs>=0.5 and $hedges_d_abs < 0.8){
echo "Medium effect (Cohen)";
}elseif($hedges_d_abs>=0.8){
echo "Large effect (Cohen)";
}else {
echo "others";
}
echo "<br>";

echo "Baseline equivalence test";
echo "<br>";
if($hedges_d_abs <= 0.05) {
echo "Satisfies the baseline equivalence requirement";
}elseif($hedges_d_abs>0.05 and $hedges_d_abs <= 0.25){
echo "Requires statistical adjustment to satisfy the baseline equivalence requirement";
}elseif($hedges_d_abs>0.25){
echo "Does not satisfy the baseline equivalence requirement";
}elseif($hedges_d_abs>=10){
echo "Something Strange happened";
}else {
echo "N/A";
}

echo "<br>";
echo "<br>";

echo "[RESULTS FOR BINARY OUTCOME]";

echo "<br>";
echo "If outcomes were binary variables (range 0 to 1), the WWC effect size would be ";
echo "" .round($WWC_binary_effect,$roundunit);

echo "<br>";
echo "T-score for the binary outcome is: " .round($Z_bin,$roundunit);
echo "<br>";

echo "<br>";
echo "T-test for binary outcomes";
echo "<br>";
if($Z_bin_abs < 1.96) {
echo "Not sig. at alpha 0.05";
}elseif($Z_bin_abs>=1.960 and $Z_bin_abs < 2.576 ){
echo "Sig at p=.05*";

}elseif($Z_bin_abs>=2.576 and $Z_bin_abs < 3.291 ){
echo "Sig at p=.01**";

}elseif($Z_bin_abs>=3.291 ){
echo "Sig at p=.001***";
}else {
echo "N/A";
}

echo "<br>";
echo "<br>";

}

 

/*echo "The result is: " . compute();*/
compute();

?>

 

<br>

REFERENCE

<br>
Cohen's rule of thumb about effect sizes:
<br>
<li>If greater than 02, Small Effect
<br>
<li>If greater than 0.5, Medium Effect
<br>
<li>If greater 0.8 then Large Effect
<br>
Cohen, J. Statistical power for the behavioral sciences (2nd ed.). Hillsdale, NJ: Erlbaum (1988).
<br>
<a href="https://wmich.edu/sites/default/files/attachments/u58/2015/Effect_Size_Substantive_Interpretation_Guidelines.pdf">
Effect Size Substantive Interpretation Guidelines: Issues in the Interpretation of Effect Sizes Jeff Valentine and Harris Cooper, Duke University(see page. 5)</a>
<br>
<br>
WWC related info:
<br>
<a href="https://ies.ed.gov/ncee/wwc/Docs/ReferenceResources/wwc_procedures_handbook_v4_draft.pdf">WWC procedures handbook (see page. 14)</a>
<br>
<a href="https://ies.ed.gov/ncee/wwc/Docs/OnlineTraining/wwc_training_m3.pdf">WWC standards slides (Definition of small sample size correction, slide 14)</a>
<br>
WWC considers the effect size greater than .25 substnatively important.
<a href="https://ies.ed.gov/ncee/wwc/Docs/referenceresources/wwc_procedures_handbook_v4.pdf">P.22 of WWC standards</a>

<br>
T-Table
<br>
<a href="https://www.sjsu.edu/faculty/gerstman/StatPrimer/t-table.pdf">T-Table</a>

<br>
<a href="calc_t_test1.php">Back to the calculcator </a>
<br>

<a href="https://www.estat.us">My website</a>
<br>
<br>

i Bond

 

https://www.treasurydirect.gov/indiv/products/prod_ibonds_glance.htm

 

Rの質問

Rの質問です。

以下は、最初のところでFAKEのデータを作っています。my_functionですけど、d_sというDATA FRAMEの中から、高校生のデータで、最初はGRADEが11の時に、データをサブセットするようになっています。その次のループでは、GRADEが12の時に、そうします。小さなデータを作るのが目的です。

問題は、これでせっかく書き出したものが、実際に、CALLされるようになっていません。eval()でできるとネットに書いてあったので試したのですがダメです。どうしたらいいでしょうか?成功すると、G11とG12という別々のデータフレームが作成されるはずなのです。

d_s <- data.frame(grade_ = c(10, 11, 12, 13, 12),

WVEIS = c(123, 134, 243, 244, 133),

annual_total_hours = c(1, 1, 5, 3, 5))

my_function <- function(var1)

{

eval(paste0('G',var1,'<-filter(d_service,grade_==',var1,')'))

}

 

my_function(11)

my_function(12)

 

今のところ、以下のように、ただ単に結果がプリントされるだけで、CALLされていません。

> my_function(13)

[1] "G13<-filter(d_service,grade_==13)"

> my_function(12)

[1] "G12<-filter(d_service,grade_==12)"

 

もしお時間がありましたら、教えていただけますか?

k u e k a w a @gmail.com までお願いします。

Selling a condominium unit in Virginia USA

Sequence of events

Buy new things (floor, carpet, AC, etc.), fix things (e.g., bathrooms), empty out the unit

Get a realtor

Saturday: Realtor comes to discuss details

Week 1

MAY 16 (Monday)

  • A photographer comes and takes pictures (free)
  • Get a resale document: I went to the website of the condo management company, fill in information, pay $350 (or so). It would be better to do this early, so you don't have to pay an expedite fee (of about $50).

MAY 17 (Tuesday)

  • Sign the contract with the realtor (commission and the price included) using DOCUSIGN

MAY 18 (Wednesday)

  • The condo management company emailed me and said he would visit us tomorrow to do the resale inspection.

MAY 19 (THURSDAY)

  • The ad for the condo unit is up on the Internet since early morning.
  • The condo mangement company staff came to check if any improvements/changes we made are in violation of the rules. This took only five minutes.

 

 

How to find color ID

There are codes for colors used for websites programming, etc. For example, white would be #FFFFFF, I think.

Imagine you want to know code for this color.

I assume you already have a graphic file that contains the color. In my case, I had a file 2022-05-09_16-26-54.png to show you the box above.

Step 1: Open Paint, which is a software program included in Windows.

Click on the bucket button (right next to a pencil icon, eraser icon, right-upper side of the screen). It will get you to the editor colors window, showing you also info such as Hue, Sat, Lum...

 

Step 2:

http://sape.inf.usi.ch/quick-reference/ggplot2/colour

How to connect old WD My Cloud directly to PC

The old version of WD My Cloud (Purchased around 2015) does not receive customer support beyond April of 2022. When I got an email notice about it, I understood this to mean that I can't use the device via Wifi beyond April of 2015. I hadn't used it for at least three years. I wanted to retrieve data from the device. I also wanted to use it if possible by directly connecting it to my PC.

I submitted a question ticket at WD website .  After a couple of email exchanges, a support staff member called me to help me with the following steps.  I'm typing this up one day after the call, so there may be some errors.

  1. Connect the device to PC via. an Ethernet cable (I got it from Amazon).

  1. Find a pen hole in the back of the device (right next to the USB port) and press it for five seconds using a needle (I had the pin that came with my Android phone; see below, but any small pin would work)

Do you see the pen hole on the right side of the USB port below?

  1. Wait until the front LED becomes solid blue (five to 10 minutes). PC will recognize the device eventually (you will see two icons in Network; double click one of them associated with the one in Storage section to find the IP address).

 

Right-click the screen and create a short-cut and type in a IP address (but start it with double backward slashes).

When you click on the WD MyCloud Icon in the storage section, you will get this kind of window (You may get a different one if you haven't set a password, etc. yet).

You may get something like this instead if you haven't set your password yet (but I am not sure). I believe you click on Users and then create a password (I already had one user already created about five years ago; I needed to assign a password to it).

I don't know what would happen if I forget my password.