Friday, December 22, 2006

.first and .last

发信人: Bighappy (快乐大大大), 信区: Statistics标 题: SAS变量生成求助
发信站: BBS 未名空间站 (Wed Dec 20 15:31:31 2006)

我现在有一个数据如下:

Saturday, November 25, 2006

unix

http://www.cs.wayne.edu/labPages/Unix_T/file_com.html#tar

Wednesday, September 27, 2006

R tricks

Tricks about graphics, apply, etc

Friday, September 01, 2006

Andreas Neumann's comment on SVG--cross platform and future

Hi,

ASV runs on almost all Linux browsers. Often, it requires a manual
install, but it works. But
it did not go through quaility testing at Adobe and there are a few
issues. The biggest
problem is, that HTML to SVG and vice versa communication is broken.
Some feautures
like sound are not existing at all. ASV on Linux is almost useless for
debuggin purposes.
You don't get any error reporting and on some browsers not even alert()
is working. But
there are workarounds like browserEval()

Looking forward and given the fact that Adobe is quiet in SVG lands, i
really recommend
looking at alternatives. Opera9 is already very useable and developing
at a fast pace. The
opera SVG developers are also very responsive when it comes to fixing
bugs. And its truly
multiplatform. The only problems I had with Opera was with some of my
bigger files. It
gets very slow if you have many elements in the DOM (>10000 elements or
so). But
feature wise it is already quit complete. I was able to run complex SVG
applications within
Opera, such as http://www.carto.net/williams/yosemite/

Firefox might also be an option. FF2 will have some minor, but useful
improvements: text
on path, additional DOM methods, such as .getTotalLength(),
.getPointAtLength(), but it is
still missing many features. Expect major improvements in FF3. Nightly
builds of FF3 are
already available for testing. Performance wise I personally had
problems with FF on Linux.
While it worked ok in Windows, it was very slow on Linux, but people
told that this was
due to some problems in my X-Server configuration, so this is probably
possible to fix.
Tim Rowley, the main SVG developer in MozillaSVG at IBM works on Linux,
so I am pretty
sure it should work reasonable if one has the right X-Server settings.

I also expect major SVG improvements in qt and KDE/Konqueror. These
people collaborate
with Apple/Safari. From what I saw in Safari, the implementation was
fast, but significant
features are still missing. I don't know when Safari/Konqueror will be
ready, SVG wise.
Several months, a year?

I strongly recommend looking at ASV alternatives. Adobe was very quiet
around SVG and
the future seems to be native SVG implementations, without the use of
a plugin. If you
write your code such that it works in Apache Batik, Opera, Firefox it
will also work in ASV
and other upcoming conformant SVG viewers/browsers.

Good luck with your project,
Andreas

Monday, May 15, 2006

vba merge excel

From: Stefan B. Rusynko - view profile
Date: Sun, Jul 2 2000 12:00 am
Email: "Stefan B. Rusynko"
Groups: microsoft.public.office.developer.vba
Not yet rated
Rating:
show options

Reply | Reply to Author | Forward | Print | Individual Message | Show original | Report Abuse | Find messages by this author

Paste this in module in a new workbook (say update.xls)

01 Sub Update() ' Macro Run from "empty" Workbook which then becomes Timesheet.xls
02 Dim iItems As Integer 'Number of Records in Time.xls
03 Windows("Employees.xls").Activate 'Data Must be Unique & Sorted
03a ' Workbooks.Open Filename:="Employees.xls" 'Or Open It with a Path
04 Range("A1").Select
05 Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
06 Selection.NumberFormat = "General" 'Get data Types Consistent
07 ActiveWorkbook.Names.Add Name:="Data", RefersToR1C1:=Selection
08 Windows("Time.xls").Activate 'Data can be Unsorted w/ Dupes
08a ' Workbooks.Open Filename:="Time.xls" 'Or Open It with a Path
09 Range("A1").Select
10 Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
11 Selection.NumberFormat = "General" 'Get data Types Consistent
12 iItems = Selection.Rows.Count 'Get # of Records
13 Selection.Copy 'Create Timesheet Core
14 ThisWorkbook.Activate
15 Range("A1").Select: ActiveSheet.Paste 'Now Get Hours
16 Range("B1").Select: Selection.EntireColumn.Insert
17 ActiveCell.Formula = "=VLOOKUP(A1,Employees.xls!Data,2,FALSE)"
18 Selection.Copy: Range(Cells(1, 2), Cells(iItems, 2)).Select
19 ActiveSheet.Paste: Application.CutCopyMode = False
20 Range("C1").Select: Selection.EntireColumn.Insert 'Get Jobs
21 ActiveCell.Formula = "=VLOOKUP(A1,Employees.xls!Data,3,FALSE)"
22 Selection.Copy: Range(Cells(1, 3), Cells(iItems, 3)).Select
23 ActiveSheet.Paste: Application.CutCopyMode = False
24 Application.CalculateFull
25 Range("A1").Select 'Break Links to Employee Data
26 Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
27 Selection.Copy: Selection.PasteSpecial Paste:=xlValues
28 Range("A1").Select: Application.CutCopyMode = False
29 ActiveWorkbook.SaveAs Filename:="Timesheet.xls" 'And Save New Book
30 End Sub

Note line numbers added only for newsreader line wraps - can be deleted
--
SBR @ ENJOY (-:

For Newsgroup Posts Always Reply to Newsgroup Only!
Direct Emails for Help are Responded to on a Pay for Service Basis.

Tuesday, January 31, 2006

statistics

english-chinese statistical terms


Correlation analysis differs from regression analysis in a few fundamental ways. In regression analysis Y is considered our random variable, but X is considered to have fixed values. In correlation analysis both Y and X are considered to be random variables. The correlation coefficient, r, only measures the strength of the linear
relationship between X and Y and it should not be used for nonlinear relationships. The coefficient of determination R^2 can be used for linear and nonlinear relationships. When R^2 is used for linear relationships then R^2 = (r)^2, but this relationship does not hold for nonlinear relationships. If one considers the population correlation coefficient rho, as opposed to the sample correlation coefficient r, X and Y are considered to come from a bivariate normal distribution. In regression analysis only Y is assumed to be normally distributed since
the values of X are assumed to be fixed. Actually Y only needs to be normal in order to find confidence intervals or perform hypothesis on the parameters. Assuming that X and Y have a bivariate normal distribution the correlation, rho, between X and Y is defined as the covariance between X and Y divided by their standard
deviations.



By Martin Holt in Medstats

It's the _expected_ value that is important (in a chi-square test). Another good reference is Ian Campbell http://www.iancampbell.co.uk/ who has researched the history....30 - odd tests....but this can be summarised as

(1) Where all expected numbers are at least 1, analyse by the 'N - 1' chi-squared test (the K. Pearson chi-squared test but with N replaced by N - 1).
(2) Otherwise, analyse by the Fisher-Irwin test, with two-sided tests carried out by Irwin's rule (taking tables from either tail as likely, or less, as that observed).

There is an online
calculator
for the 'N-1' chi-squared test.

I think that's a bit more explicit !

Saturday, January 28, 2006

Perl

from
http://aspn.activestate.com/ASPN/docs/ActivePerl-5.6/faq/ActivePerl-faq2.html#repositories
Where are the package repositories?
http://ppm-ia.ActiveState.com/PPM/ppmserver.plex?urn:/PPM/Server/SQL New 3.0 Repository from ActiveState
http://www.ActiveState.com/cgibin/PPM/ppmserver.plex?urn:/PPMServer The default package repository from ActiveState
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer University of Winnipeg
http://Jenda.Krynicky.cz/perl Jan Krynicky's package repository
http://www.roth.net/perl/packages/ Roth Consulting's package repository
http://www.xray.mpe.mpg.de/~ach/ptk/ppm Achim Bohnet's package repository
http://rto.dk/packages/ RTO's packages repository (mostly mirrors of the above)
http://www.fastnetltd.ndirect.co.uk/Perl/zips/ Fastnet Software Ltd's packages - not directly accessible from PPM at present

Wednesday, January 25, 2006

graphics

google directory of graph drarwing
an article about drawring graph
Graphviz - Graph Visualization Software

categorical data analysis

Consider two studies to look the relationship between
smoking and number of colds in 2004.

i) The first gives a questionaire to n=150 people and asks them

How much do you smoke?
a. not at all
b. a pack or less of cigarettes per day
c. more than a pack of cigarettes per day

How many colds did you have last year?
a. none
b. 1
c. 2
d. 3 or more

The 150 people were then put in a 3 by 4 contingency table:

# of colds in 2004
| 0 | 1 | 2 | >=3 |
--------------------------
No cigs | n11 | n12 | n13 | n14 | n1+
|------------------------|
1 pack/day | n21 | n22 | n23 | n24 | n2+
|------------------------|
>1 pack/day | n31 | n32 | n33 | n34 | n3+
|------------------------|
n+1 n+2 n+3 n+4 n=150

This is a single multinomial situation with 12
cells and therefore 11 free parameters
pi11, pi12, ..., pi34. It looks like 12 parameters
but pi11+pi12+ ...+ pi34=1. So because of this constraint,
there are only 11. Note that n1+, n2+, n3+, n+1, etc. are random.

This is a survey or cross-sectional study. It might be called
retrospective in the sense that they were asked to report on
the previous year even though the survey is taken at one point
in time. It is observational.


ii) The second study interviews people at the beginning of 2004
and chooses 50 nonsmokers, 50 less than one pack a day smokers,
and 50 more than one pack a day smokers. They are asked to keep
a diary of the colds they get during 2004. At the end of 2004,
they are asked to give the number of colds they had. This
data is put into a contingency table that looks pretty much
the same as for the first study:

# of colds in 2004
| 0 | 1 | 2 | >=3 |
--------------------------
No cigs | n11 | n12 | n13 | n14 | n1+=50
|------------------------|
1 pack/day | n21 | n22 | n23 | n24 | n2+=50
|------------------------|
>1 pack/day | n31 | n32 | n33 | n34 | n3+=50
|------------------------|
n+1 n+2 n+3 n+4 n=150

The main difference is that the row totals are fixed at 50 each.
Also, the rows are independent multinomials

mult(n=50;pi1|1, pi2|1, pi3|1, pi4|1) 3 free parameters
mult(n=50;pi1|2, pi2|2, pi3|2, pi4|2) 3 free parameters
mult(n=50;pi1|3, pi2|3, pi3|3, pi4|3) 3 free parameters

This is a cohort study. It is prospective. It is observational.

You really can't do a clinical trial on colds and smoking unless
you could actually force people to smoke or not smoke. Only bad
guys can carry out such clinical trials.

A case-control study wouldn't make sense here either. With a
case-control, you typically are interested in a rare event like
cancer or heart attack. So you could get a group of people who
had lung cancer in 2004 and find out their smoking habits. Then
get a group of people without lung cancer (the controls) but similar
in other ways to the cases, and ask about their smoking behavior.
That would result in a table like

Lung No
|Cancer|L.Ca.|
---------------
No cigs | n11 | n12 | n1+
|-------------
1 pack/day | n21 | n22 | n2+
|-------------
>1 pack/day | n31 | n32 | n3+
|-------------
100 100 n=200

Notice that we now have two independent multinomial columns. We could
use "local odds" ratios, No cigs vs. 1 pack/day, and No cigs vs.
>1 pack/day.

Tuesday, January 24, 2006

svg

jim Ley 's homepage
Jeff Schiller 's page
SVG portal: a collection of svg links
SVG wiki
another SVG guru,the plainest website
online painter, generating SVG
svg widgets library. BioViz is built upon it. More examples on bioinformatics can be found over there.
ideal interface of map, too hard for me.
ASV autoInstall from adobe
SVG site
ajax svg based freehand drawer, good for flow chart; a similar site
debug SVG in IE
svg demo
Jeff Schiller's SVG tutorial
sever side SVG configuration

Interactive Topographic Web-Maps Using SVG
CGUI
toolkit uses an object oriented ECMAScript library to create SVG based Custom GUI elements inside a web browser.

Mozilla ActiveX Control
A taste of REX, AJAX and SVG
upload files using Ajax
=================================================================
Holger Will's introduction to SVG zooming

for zoom and pan you have several options, you could use
transformations, or
modify the viewBox, but the best option you have are the two methods
currentScale/currentTranslate of the SVGSVGElement. see:
http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement

basicly zoomIn would be accomplished with:
document.documentElement.currentScale*=1.5

end of Holger Will
=================================================================

=================================================================
svg server side setting

AddType image/svg+xml .svg
AddType image/svg+xml .svgz
AddEncoding gzip .svgz

copy the above text to .htaccess in webspaces root directory.
=================================================================

latex

  • latex link at kent

  • 王垠的个人主页

    linking

    we are changing our way of learning: we index our knowledge by keywords and retrieve them by google when it is need. However, a more efficient and personalized way of ranking webpages is to continously bookmarking as surfing