全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
3726 2
2021-04-15
悬赏 10 个论坛币 已解决
各位stata的大佬们好,我想对数据中JournalTitle中出现的字符串进行统计,请问要怎么操作,谢谢回答!
clear
input long aid int pubyear str239 journal_title float(d_value career_age N)
4670844 2000 "The American naturalist"                                                                                         -.0556622  9  6
227960 2000 "Angewandte Chemie (International ed. in English)"                                                                        0  9  6
3279037 2000 "Journal of veterinary cardiology : the official journal of the European Society of Veterinary Cardiology"                0  9  6
8453307 2000 "IEEE transactions on ultrasonics, ferroelectrics, and frequency control"                                                 0  9  6
8894826 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society"                             0  9  6
4431279 2000 "The American naturalist"                                                                                          .0789474  9  6
527603 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society"                      -.025641 10 17
3412062 2000 "IEEE transactions on image processing : a publication of the IEEE Signal Processing Society"                      -.012987 10 17
7351204 2000 "The American naturalist"                                                                                         -.0118483 10 17
1324929 2001 "Journal of evolutionary biology"                                                                                -.00499445 10 17
7777752 2001 "Journal of investigative medicine : the official publication of the American Federation for Clinical Research"  -.00144748 10 17
3472062 2001 "Calcified tissue international"                                                                                          0 10 17
4513185 2000 "Bioscience, biotechnology, and biochemistry"                                                                             0 10 17
1070450 2001 "Phytopathology"                                                                                                          0 10 17
5663726 2001 "Journal of health psychology"                                                                                            0 10 17
2608510 2001 "Journal of tropical pediatrics"                                                                                          0 10 17
6304401 2001 "Comparative and functional genomics"                                                                             .00172861 10 17
8096653 2001 "Mycorrhiza"                                                                                                       .0078125 10 17
4717488 2000 "Avian pathology : journal of the W.V.P.A"                                                                         .0163934 10 17
7188770 2000 "The American naturalist"                                                                                          .0632911 10 17
4452688 2001 "Angewandte Chemie (International ed. in English)"                                                                 .0987654 10 17
5598028 2001 "Oecologia"                                                                                                         .232877 10 17
9001194 2000 "Environmental management"                                                                                              .75 10 17
2373133 2002 "Oecologia"                                                                                                        -.133333 11 34
5203462 2002 "Oecologia"                                                                                                           -.072 11 34
4670844 2002 "Oecologia"                                                                                                       -.0615385 11 34
5203462 2002 "Oecologia"                                                                                                       -.0393701 11 34
4790330 2001 "The American naturalist"                                                                                          -.037037 11 34
8070924 2002 "Oecologia"                                                                        


最佳答案

DΘstinyじò 查看完整内容

统计journal_title变量每一类值的个数吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2021-4-15 19:58:43
统计journal_title变量每一类值的个数吗?
复制代码
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2021-4-16 00:34:38
public class StringTest3 {

    public static void main(String[] args) {
        //定义一个字符串
        String s = "Person1314Study";
        
         //定义三个统计变量
        int bignum = 0;
        int smallnum = 0;
        int numbernum = 0;
        
        //遍历字符串,得到每一个字符。
        for(int x=0;x<s.length();x++){
            char ch = s.charAt(x);
            
         //判断该字符到底是属于那种类型的
            if(ch>='A' && ch<='Z'){
                bignum++;
            }
            else if(ch>='a' && ch<='z'){
                smallnum++;
            }
            else if(ch>='0' && ch<='9'){
                numbernum++;
            }
        }
        //输出结果。
        System.out.println("含有"+bignum+"个大写字母");
        System.out.println("含有"+smallnum+"个小写字母");
        System.out.println("含有"+numbernum+"个数字");
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群