Re: [rkward-devel] power analysis plugin

2014-10-08 Thread meik michalke
hi thomas,

Am Dienstag, 7. Oktober 2014, 13:43:33 schrieb Thomas Friedrichsmeier:
 - For the two sample tests, when estimating the size of one of the samples,
 why not always make it the second sample (i.e. first sample size provided)?

fixed (in the script).

 - Syntax error for estimating sample size in different sample sizes
 proportion test.

fixed (in the script). not the first time, all those commas are a mess :-D

 - In some cases, you get the not-so-helpful error message:
  Error in uniroot(function(n2) eval(p.body) - power, c(2 + 1e-10, 1e+07)) :
f() values at end points not of opposite sign

fixed (in the script). applied you suggested message, seems to work.

 - For GLM, would it make sense to allow to specify number of parameters to
 estimate, and sample size (N), instead of numerator / denominator df?

i went for the wording used by ?pwr.f2.test, but i admit it sounds a bit scary 
;-)

 - In the generated printout() code, things might get slightly simpler, if
 you print the header earlier:

ok, partly changed it already in the script. will look at it later.

 - That said, I wonder, whether the following printout would be good enough
 (after the rk.header()):
rk.print.literal (capture.output (print (x)))
 (we could add a new function rk.print.simple(x) for this kind of output.
 It would probably make sense in other places, too).

to me it looks a bit more consistent with the RKWard output you're used to 
now. it partly emulates what print.power.htest() does, but with rk.* 
functions. for copypaste scenarios, i'd prefer that table.

btw, if you have text for the help file, i would like to try to put it in the 
rkwarddev script, to test a new possibility to generate .rkh files i 
implemented just yesterday. it stores text for elements by ID in an 
environement, and when rk.plugin.component() or rk.plugin.skeleton() use the 
scan option for setting nodes, that text is automatically filled in. to 
get the text into the environment, you can now provide it with the same 
functions which generates the XML element, e.g.

 rk.set.comp(Example component)
 rk.XML.cbox(
   label=Cherry,
   value=cherry,
   help=Check this to get a cherry on top.)

without rk.set.comp() you'd have to 'add component=Example component' to the 
rk.XML.cbox() call, which is a bit annoying after the third time... to see the 
stored text, run

 rk.get.rkh.prompter()
  

viele grüße :: m.eik


-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


Re: [rkward-devel] power analysis plugin

2014-10-08 Thread Thomas Friedrichsmeier
Hi,

On Wednesday 08 October 2014 11:49:56 meik michalke wrote:
  - For GLM, would it make sense to allow to specify number of parameters
  to
  estimate, and sample size (N), instead of numerator / denominator df?
 
 i went for the wording used by ?pwr.f2.test, but i admit it sounds a bit
 scary ;-)

thinking about it, there is one scenario, where my idea won't work, namely 
when estimating the number of estimatable parameters (or numerator df). In 
this case there is no trivial mapping from sample size to denominator df.

Well, a small reminder on the relation between parameter count, number of 
observations, and df, in the help file will come in handy...
 
  - That said, I wonder, whether the following printout would be good enough
  
  (after the rk.header()):
 rk.print.literal (capture.output (print (x)))
  
  (we could add a new function rk.print.simple(x) for this kind of output.
  It would probably make sense in other places, too).
 
 to me it looks a bit more consistent with the RKWard output you're used to
 now. it partly emulates what print.power.htest() does, but with rk.*
 functions. for copypaste scenarios, i'd prefer that table.

True, that would be somewhat inconsistent. But actually for some plugins, I'm 
not entirely satisfied with the output generated by rk.print()/HTML(). Esp. 
print lm estimation results. So that's where the idea came from. But we'll 
leave it for now.
 
 btw, if you have text for the help file, i would like to try to put it in
 the rkwarddev script, to test a new possibility to generate .rkh files i
 implemented just yesterday.

Not much. I started, then stumbled across those issues, then got side-tracked. 
This is all I got so far:

## Documentation
pwr.rkh.summary - rk.rkh.summary (Perform power anaylsis for a variety of 
statistcal methods.)
pwr.rkh.usage - rk.rkh.usage (Given three of the parameters 'power of test', 
'sample size', 'effect size', and 'significance level', this plugin will 
estimate the fourth, i.e. for example the test power of a t.test at a given 
sample size, effect size, and level of significance. On the left hand control, 
select which of the parameters to estimate. In the middle, specify the 
statistical method, on the right hand side, enter the values of the given 
parameters.)
pwr.rkh.settings - rk.rkh.settings (
  rk.rkh.setting (pwr.parameter.rad, text=Parameter to estimate, given the 
others.),
  rk.rkh.setting (pwr.parameter.towsamples.rad, text=Only shown when 
applicable: For estimating the required sample sizes for a test with two 
differently sized samples, specify which should be estimated, and which is 
given.)
)

 it stores text for elements by ID in an
 environement, and when rk.plugin.component() or rk.plugin.skeleton() use
 the scan option for setting nodes, that text is automatically filled
 in. to get the text into the environment, you can now provide it with the
 same functions which generates the XML element, e.g.
 
  rk.set.comp(Example component)
  rk.XML.cbox(
label=Cherry,
value=cherry,
help=Check this to get a cherry on top.)
 
 without rk.set.comp() you'd have to 'add component=Example component' to
 the rk.XML.cbox() call, which is a bit annoying after the third time... to
 see the stored text, run
 
  rk.get.rkh.prompter()

Not pretending, I understood this, completely, but sounds good. Will try when 
I have a bit of time (not today).

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


[rkward-devel] quick (hopefully) feature request: show some NA info in data editor

2014-10-08 Thread meik michalke
hi,

right now, the data editor doesn't visibly discriminate between NA, NA or  
in cells, they're all plain white, which can be a problem especially when 
dealing with strings. would it be much work to have those empty cells show 
some kind of greyed-out indicator wheter they are just empty strings () or 
really NA?

related to this, i repeatedly had a problem with SPSS data sets where 
read.spss() did not trim string values, so they ended up like

  value 

and you didn't see the spaces. i have no idea yet how to solve this nicely 
(meaning: make it visible), but it's an awful trap if you're wondering why the 
hell your script doesn't find a match for value.


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel


[rkward-devel] writing docs [was: power analysis plugin]

2014-10-08 Thread meik michalke
hi,

i'll concentrate on this part:

Am Mittwoch, 8. Oktober 2014, 14:01:25 schrieb Thomas Friedrichsmeier:
   rk.set.comp(Example component)
   rk.XML.cbox(
 label=Cherry,
 value=cherry,
 help=Check this to get a cherry on top.)
  
  without rk.set.comp() you'd have to 'add component=Example component' to
  the rk.XML.cbox() call, which is a bit annoying after the third time... to
  see the stored text, run
  
   rk.get.rkh.prompter()
 
 Not pretending, I understood this, completely, but sounds good. Will try
 when I have a bit of time (not today).

i've added your parts to the script now, hopefully when you look at the 
changes you get an idea how this works. but it's true, i should explain a bit 
more:

there has long been a function called rk.rkh.scan() in rkwarddev, which tries 
to generate a complete skeleton for an .rkh file from a given XML file (or XML 
object). it knows a list of XML tags which might need a setting node in the 
help file, and therefore automatically generates a file which is already 
structured according to the particular plugin component. but it still missed 
the actual text for each setting. this has changed yesterday.

with the recent SVN version of rkwarddev, all functions which generate those 
relevant XML nodes in the first place now have two additional arguments, 
help and component (as you can define several components in one script, 
naming the belonging component here was necessary). the interesting one is 
help, which takes the information you would usually give as text to 
rk.rkh.setting(); that is, you souldn't need to call rk.rkh.setting() at all 
any more, and still get your help text to the right place in the .rkh file.

an example -- until recently:

  pwr.parameter.rad - rk.XML.radio(label=Parameter to determine,
options=list(
  Power of test=c(val=Power, chk=TRUE),
  Sample size=c(val=Sample size),
  Effect size=c(val=Effect size),
  Significance level=c(val=Significance level)
), id.name=rad_pwr_param)

  rk.rkh.scan(pwr.parameter.rad)

calling rk.rkh.scan() would have recognized radio as something to be 
documented and return a setting node for you to fill with text:

  setting id=rad_pwr_param
  /setting

alternatively, you would manually call rk.rkh.setting() to create that node 
including text.

now, you can document the radio node at the same time you create it with 
rk.XML.radio():

  pwr.parameter.rad - rk.XML.radio(label=Parameter to determine,
options=list(
  Power of test=c(val=Power, chk=TRUE),
  Sample size=c(val=Sample size),
  Effect size=c(val=Effect size),
  Significance level=c(val=Significance level)
), id.name=rad_pwr_param,
help=Parameter to estimate, given the others.,
component=Power analysis)

  rk.rkh.scan(pwr.parameter.rad, component=Power analysis)

this call to rk.rkh.scan() will now return the complete setting node:

  setting id=rad_pwr_param
Parameter to estimate, given the others.
  /setting

and since rk.rkh.scan() can be invoked by rk.plugin.skeleton() and 
rk.plugin.component(), your help file is almost already written when you 
designed the XML elements. you still need to write a summary and usage 
section, but all *settings* can be documented in place.

when i tested this, i soon noticed that copying the same component stuff to 
every function call will bloat the script. so there's also a function to set a 
current default component:

  rk.set.comp(Power analysis)

all relevant rk.XML.* functions have component=rk.get.comp() as the default 
value, which means 

  pwr.parameter.rad - rk.XML.radio(label=Parameter to determine,
options=list(
  Power of test=c(val=Power, chk=TRUE),
  Sample size=c(val=Sample size),
  Effect size=c(val=Effect size),
  Significance level=c(val=Significance level)
), id.name=rad_pwr_param,
help=Parameter to estimate, given the others.)

will also get the job done if rk.set.comp() was called accordingly. one 
important thing: the component name must match the name argument given to 
rk.plugin.component(), or the name argument passed to pluginmap (the main 
component) in rk.plugin.skeleton(). otherwise it won't be found.

finally: setting help to FALSE will omit the XML node from the documentation 
-- something which wasn't possible with the previous scan method either.


viele grüße :: m.eik

-- 
  dipl. psych. meik michalke
  institut fur experimentelle psychologie
  abt. fur diagnostik und differentielle psychologie
  heinrich-heine-universitat d-40204 dusseldorf

signature.asc
Description: This is a digitally signed message part.
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

Re: [rkward-devel] quick (hopefully) feature request: show some NA info in data editor

2014-10-08 Thread Thomas Friedrichsmeier
Hi,

On Wednesday 08 October 2014 16:18:17 meik michalke wrote:
 right now, the data editor doesn't visibly discriminate between NA, NA or
  in cells, they're all plain white, which can be a problem especially
 when dealing with strings. would it be much work to have those empty
 cells show some kind of greyed-out indicator wheter they are just empty
 strings () or really NA?

true, that's easy enough. Check current SVN.

(Now, next you'll want a more obvious method to differentiate between NA and 
 while _entering_ strings...)
 
 related to this, i repeatedly had a problem with SPSS data sets where
 read.spss() did not trim string values, so they ended up like
 
   value 
 
 and you didn't see the spaces. i have no idea yet how to solve this nicely
 (meaning: make it visible), but it's an awful trap if you're wondering why
 the hell your script doesn't find a match for value.

Well, that's more difficult, indeed. One option would be showing all strings 
quoted, but I'd say that's not without potential for confusion, either...

Regards
Thomas

signature.asc
Description: This is a digitally signed message part.
--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel